Open HealthyPear opened 11 months ago
There are two things you can do I think: use setuptools_scm to get the version from the git tags for the python bindings independently of cmake.
Or import the version from the c++ library in the python module and use a "dynamic" version: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
Thanks @maxnoe .
I'd go for the second approach in order to not duplicate code (even though it's not really a duplication in this case).
I see that you link the pyproject.toml
example: do you know if it is possible to define the version metadata entry there and keep the rest of the project metadata into setup.cfg
or since it's related to the [project] part it's better to directly upgrade to use only pyproject.toml
?
You can give the same option in the setup.cfg.
This PR implements a new GitHub workflow based on the current best practice recommended by the Python Packaging Authority.
I already created a “pending” trusted publisher on PyPI with my account for this project and the workflow is set to run only when a release is published (whatever the tag name).
@maxnoe could you give a second look at this? My biggest doubt is about how to treat the git-metadata version which is now read by the CMake configuration, but still hardcoded in
setup.cfg
to "4.0.0" (which is still unreleased); from the setuptools guide I don't see dynamic version available but from thepyproject.toml
implementation - should this part be done like in e.g. ctapipe with theversion.py
file?I'll keep it as a draft PR until we have sorted out if it's correct.