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

Add workflow for deployment to PyPI #106

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HealthyPear
Copy link
Contributor

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 the pyproject.toml implementation - should this part be done like in e.g. ctapipe with the version.py file?

I'll keep it as a draft PR until we have sorted out if it's correct.

@HealthyPear HealthyPear mentioned this pull request Oct 16, 2023
@maxnoe
Copy link
Contributor

maxnoe commented Oct 16, 2023

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

@HealthyPear
Copy link
Contributor Author

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?

@maxnoe
Copy link
Contributor

maxnoe commented Oct 18, 2023

You can give the same option in the setup.cfg.

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

Successfully merging this pull request may close these issues.

2 participants