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

Move script installation from setuptools/setup.py to pyproject.toml #2676

Closed
lunkwill42 opened this issue Sep 6, 2023 · 0 comments · Fixed by #2679
Closed

Move script installation from setuptools/setup.py to pyproject.toml #2676

lunkwill42 opened this issue Sep 6, 2023 · 0 comments · Fixed by #2679
Assignees
Labels

Comments

@lunkwill42
Copy link
Member

lunkwill42 commented Sep 6, 2023

Is your feature request related to a problem? Please describe.

#2655 moved more of NAV's Python package definition into pyproject.toml, but script installation from the bin/ directory is still handled by setuptools in setup.py.

Describe the solution you'd like

Our goal is to remove setup.py in its entirety, so we need to define the installable scripts in pyproject.toml instead.

However, a scripts definition in pyproject.toml cannot be code based. All scripts need to be referenced explicitly, and rather than being pointers to just a script file, they need to be resolvable as a function in a Python module.

Example:

[project.scripts]
my_package_cli = 'my_package.console:run'

This installs a command my_package_cli which will run the run function in the my_package.console module.

This means that NAV's script files need to move out ot bin/ and somewhere into python/nav/. I suggest simply python/nav/bin/ for now.

I suppose all the existing scripts have main functions as their entrypoint.

Additionally, there are integration tests that enumerate all the scripts in the bin/ directory and test that they can be run without error. These tests will need to change, but perhaps they only need to find the scripts in a new directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants