Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: allow native specification of project source files location #900

Open
ikappaki opened this issue Jun 5, 2024 · 0 comments
Labels
issue-type:enhancement New feature or request

Comments

@ikappaki
Copy link
Contributor

ikappaki commented Jun 5, 2024

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue-type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants