You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
7
## [Unreleased]
8
+
### Added
9
+
* Added the `-p`/`--include-path` CLI command to prepend entries to the `sys.path` as an alternative to `PYTHONPATH` (#1027)
10
+
* Added an empty entry to `sys.path` for all CLI entrypoints (`basilisp run`, `basilisp repl`, etc.) (#1027)
11
+
8
12
### Changed
9
13
* The compiler will no longer require `Var` indirection for top-level `do` forms unless those forms specify `^:use-var-indirection` metadata (which currently is only used in the `ns` macro) (#1034)
10
14
* nREPL server no longer sends ANSI color escape sequences in exception messages to clients (#1039)
11
15
12
16
### Fixed
13
17
* Fix a bug where the compiler would always generate inline function definitions even if the `inline-functions` compiler option is disabled (#1023)
14
-
* Fix a bug where `defrecord`/`deftype` constructors could not be used in the type's methods. (#1025)
18
+
* Fix a bug where `defrecord`/`deftype` constructors could not be used in the type's methods (#1025)
15
19
* Fix a bug where `keys` and `vals` would fail for records (#1030)
16
20
* Fix a bug where operations on records created by `defrecord` failed for fields whose Python-safe names were mangled by the Python compiler (#1029)
17
21
* Fix incorrect line numbers for compiler exceptions in nREPL when evaluating forms in loaded files (#1037)
Copy file name to clipboardExpand all lines: docs/cli.rst
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,28 @@ Basilisp exposes all of it's available configuration options as CLI flags and en
14
14
All Basilisp CLI subcommands which include configuration note the available configuration options when the ``-h`` and ``--help`` flags are given.
15
15
Generally the Basilisp CLI configuration options are simple passthroughs that correspond to :ref:`configuration options for the compiler <compiler_configuration>`.
16
16
17
+
.. _cli_path_configuration:
18
+
19
+
``PYTHONPATH`` Configuration
20
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+
22
+
Basilisp uses the ``PYTHONPATH`` environment variable and :external:py:data:`sys.path` to determine where to look for Basilisp code when :ref:`requiring namespaces <namespace_requires>`.
23
+
Additional values may be set using the ``-p`` (or ``--include-path``) CLI flags.
24
+
Depending on how Basilisp is invoked from the CLI, an additional entry will automatically be added unless explicitly disabled using ``--include-unsafe-path=false``:
25
+
26
+
* An empty string (which implies the current working directory) will be prepended to the ``sys.path`` in the following cases:
27
+
28
+
* Starting a REPL
29
+
* Running a string of code directly (using ``run -c``)
30
+
* Running code directly from ``stdin`` (using ``run -``)
31
+
* Running a namespace directly (using ``run -n``)
32
+
33
+
* When running a script directly (as by ``run /path/to/script.lpy``), the parent directory of the script will be prepended to ``sys.path``
Copy file name to clipboardExpand all lines: docs/reader.rst
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -474,9 +474,10 @@ Custom Data Readers
474
474
475
475
When Basilisp starts it can load data readers from multiple sources.
476
476
477
-
It will search in :external:py:attr:`sys.path` for files named ``data_readers.lpy`` or else ``data_readers.cljc``; each which must contain a mapping of qualified symbol tags to qualified symbols of function vars.
477
+
It will search in :external:py:data:`sys.path` for files named ``data_readers.lpy`` or else ``data_readers.cljc``; each which must contain a mapping of qualified symbol tags to qualified symbols of function vars.
478
478
479
479
.. code-block:: clojure
480
+
480
481
{my/tag my.namespace/tag-handler}
481
482
482
483
It will also search for any :external:py:class:`importlib.metadata.EntryPoint` in the group ``basilisp_data_readers`` group.
Basilisp uses the ``PYTHONPATH`` environment variable and :external:py:data:`sys.path` to determine where to look for Basilisp code when requiring namespaces.
110
+
This is roughly analogous to the Java classpath in Clojure.
111
+
These values may be set manually, but are more often configured by some project management tool such as Poetry or defined in your Python virtualenv.
112
+
These values may also be set via :ref:`cli` arguments.
0 commit comments