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

Make the {{ cookiecutter.repo_name }}/src package installable #34

Open
ESKYoung opened this issue Jun 21, 2021 · 1 comment
Open

Make the {{ cookiecutter.repo_name }}/src package installable #34

ESKYoung opened this issue Jun 21, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ESKYoung
Copy link
Collaborator

ESKYoung commented Jun 21, 2021

It might be useful to make the src package installable by adding a setup.py file. Adding this could make it easier to publish packages on PyPI, and may also resolve some of the path issues that can occur when using Jupyter notebooks. Note you may need the autoreload Jupyter extension to get all the latest local changes for a locally installed package.

Some things to consider:

  • moving all the subfolders within {{ cookiecutter.repo_name }}/src into something like{{ cookiecutter.repo_name }}/src/{{ cookiecutter.repo_name.lower().replace(' ', '_').replace('-', '_' ) }}
  • adding a {{ cookiecutter.repo_name }}/setup.py; for examples see ONS Best Practice and Impact, or navdeep-G's one
  • adding -e . to {{ cookiecutter.repo_name }}/requirements.txt
  • refactoring any environment variables related to folder paths within {{ cookiecutter.repo_name }}/src
  • refactoring any relevant documentation and tests
@ESKYoung ESKYoung added enhancement New feature or request good first issue Good for newcomers labels Jun 21, 2021
@r-leyshon
Copy link

Upvoting as this causes a bit of work every time I use the repo template.

Following the example in the python docs, I find the hatchling build with a pyproject.toml setup (no setup.* files) to be the most straightforward. Also to alter the src directory to src/package_name as in the docs example.

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

No branches or pull requests

2 participants