-
-
Notifications
You must be signed in to change notification settings - Fork 23
Add GitHub Actions workflow for PyPI publishing #73
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, the changes may make sense but I don’t know much about this stuff and it is uneasy to follow without references to the docs. See the comments.
# automatically filled in and updated by poetry-dynamic-versioning plugin | ||
# in distributions | ||
__version__ = "0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add references to the related docs at the bottom of your first commit message. Is it the one below?
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#static-vs-dynamic-metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the general pyproject.toml reference yes but this change is from poetry and poetry-dynamic-versioning specific. If we were using setuptools instead of poetry, this would be done differently.
Basically, poetry-dynamic-versioning plugin during build time substitutes the __version__
attribute with the current version in the sdist and the wheel. I can leave it an empty string here and the substitution would work fine but I chose to use 0.0.0
as that's the base version in pyproject.toml as well. The base version is an arbitrary version required by poetry in tool.poetry
section. I have added references to both poetry's and poetry-dynamic-versioning plugin's documentation in the first commit.
Transitioned from Poetry-specific metadata to PEP 621 standard using `[project]` and added `poetry-dynamic-versioning` for dynamic version management using git tags. The `poetry-dynamic-versioning` needs to be installed manually during development by running `poetry self add 'poetry-dynamic-versioning[plugin]'`. References for dynamic versioning with poetry: - https://python-poetry.org/docs/pyproject/#version - https://github.com/mtkennerly/poetry-dynamic-versioning?tab=readme-ov-file#installation
The workflow carries out the following steps: 1. Check out the repository. 2. Install Python. 3. Install Poetry (with the required plugins). 4. Build the package. 5. Publish the package to pypi. The publishing process does not require the use of any credentials or keys as it utilizes Pypi's "Trusted Publishing" support. See also: https://docs.pypi.org/trusted-publishers/.
5e1dbc4
to
ff4e978
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed commit messages!
Let’s merge and release as 30.0.1
🚢
Add GitHub Actions workflow for PyPI publishing. Transitioned from Poetry-specific metadata to PEP 621 standard using
[project]
and addedpoetry-dynamic-versioning
for dynamic version management using git tags.