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
In Clojure, it is typical for source code to reside in a subdirectory of the project root, such as the src directory. However, it is not immediately clear how to achieve this in Basilisp.
The section Using Basilisp in a Project of the documentation, suggests placing source code in the src directory and tests in the tests directory, and defers to Python dependency tools for handling this setup.
However, users coming from a Clojure background might not be familiar with Python project tools or how to use them. They may be primarily interested in Python interop, and picking up a Python project management tool just to write some Basilisp/Clojure code can be a steep learning curve.
Alternatively, we could adopt a more familiar approach for Clojure users by using a project file similar to deps.edn, as outlined in the basilisp.edn ticket.
I suggest introducing :paths key in basilisp.edn, similar to the :paths key in deps.edn. This key would allow the REPL (and nREPL) to add the listed paths to the sys.path list of directories that the Python interpreter searches for source code.
For example, given a directory structure
<project root>
|-- basilisp.edn
|-- src dir
|-- other-sources dir
and a basilisp.edn file
{:paths ["src-dir""other-sources"]}
The REPL would add the src and other-sources directories to the sys.path variable at startup. I assume, advanced users who prefer to use a Python management tool would need to include the same paths in their project configuration file.
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
In Clojure, it is typical for source code to reside in a subdirectory of the project root, such as the
src
directory. However, it is not immediately clear how to achieve this in Basilisp.The section Using Basilisp in a Project of the documentation, suggests placing source code in the
src
directory and tests in thetests
directory, and defers to Python dependency tools for handling this setup.However, users coming from a Clojure background might not be familiar with Python project tools or how to use them. They may be primarily interested in Python interop, and picking up a Python project management tool just to write some Basilisp/Clojure code can be a steep learning curve.
Alternatively, we could adopt a more familiar approach for Clojure users by using a project file similar to
deps.edn
, as outlined in the basilisp.edn ticket.I suggest introducing
:paths
key inbasilisp.edn
, similar to the :paths key in deps.edn. This key would allow the REPL (and nREPL) to add the listed paths to thesys.path
list of directories that the Python interpreter searches for source code.For example, given a directory structure
and a
basilisp.edn
fileThe REPL would add the
src
andother-sources
directories to thesys.path
variable at startup. I assume, advanced users who prefer to use a Python management tool would need to include the same paths in their project configuration file.Thanks
The text was updated successfully, but these errors were encountered: