Add GitHub Actions workflow for PyPI publishing#73
Conversation
yvanzo
left a comment
There was a problem hiding this comment.
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.
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.
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
yvanzo
left a comment
There was a problem hiding this comment.
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-versioningfor dynamic version management using git tags.