[Feature request] - update python packaging
Closed this issue · 5 comments
I've been looking through a few F4E repos recently and I see most have setup.py or setup.cfg files. I noticed this one also has a partial pyproject.toml file. We could move these setup files entirely to pyproject.toml files to keep up to date with the latest python packaging recommendations
- https://packaging.python.org/en/latest/guides/modernize-setup-py-project/#modernize-setup-py-project
- https://packaging.python.org/en/latest/tutorials/packaging-projects/
While updating we could also move to a src/jade
layout instead of the jade
folder structure. The version could be moved to the pyprojects and we could make use of import importlib.metadata
to make the jade.__version__
attribute or if we are really keen then we could make use of the setuptools_scm to track the version for us.
Describe the solution you'd like
- pyproject.toml instead of setup.py + setup.cfg
- src/jade instead of jade folder structure
- importlib.metadata or setuptools_scm to get version number
Describe alternatives you've considered
could also leave things as they are
Additional context
while setup.py is not depreciated the command commonly associated with a setup.py file python setup.py install
is now depreciated and pyproject.toml is "strongly recommened" for python packaging
Due to the number of times we are forgetting to update the version number before release I'm starting to think we should find the time to do this with a quick "git mv" and then implement dynamic versioning
I agree on dynamic versioning for python. May we use something similar for the versioning of JADE (for the prompt header for instance)?
I was referring to dynamic versioning for JADE. The prompt header (and other strings) are already all connected to a single variable in the version.py file. The problem is that at the moment we are updating this constant by hand.
Perhaps this package helps, it takes the version number from the git release tags
https://github.com/pypa/setuptools-scm
It has been a bit of a journey but at the moment (developing branch) jade is setup as a package and ready to be automatically uploaded to PyPi once the next JADE v4 will be released