Adopt setuptools_scm for aligning releases with GitHub tags
setuptools_scm can be used to handle versioning and with an appropriate GitHub Action and configuration of an account can make releases align on GitHub and PyPI.
pySPM uses poetry though, fortunately there is a
poetry-setuptools-csm-plugin that we can leverage to
integrate which ignores the version listed under tool.poerty.version and instead obtains it dynamically from the Git
Tag.
Required actions
According to the documentation for poetry-setuptools-csm-plugin only a single change is required...
- [ ] Add
[tool.setuptools_scm]. - [ ] [Optional] Remove
[tool.poetry.version]as it would be ignored. - [ ] Addition of appropriate GitHub Action/workflow (see here).
Possible problems
- As noted on the plugin page this may be contrary to the Poetry team philosophy.
- It would require @scholi to setup GitHub as a Trusted publisher
Advantages
- Releases could be made by tagging a commit here on GitHub (or when a local tag is pushed).
- PyPI and GitHub releases would be aligned.
Hi. I have added a workflow and added github as trusted publisher to both PyPi and TestPyPi. It seems that testPyPi is not working now. I will have to dig later on the issue
can we actually test the workflow without pushing them? Here I had to make 4 commits for testing/fixing....
Oh I found a typo and now pushing to test.pypi.org works !