[Build] Use setuptools_scm to allow git as the SSOT for package version
Instead of hardcoding the version into the repo, use git tags as the single source of truth for project's version, eliminating human error on releases. To do this we can use setuptools_scm.
Hi! May I work on this issue?
Hi @shahar4499!
Can you please elaborate on the following points:
- What's the current release process you want to automate versioning for, if I understood correctly?
- Assuming you want the version to be determined by a git tag, which part of which flow (a github action presumably?) will produce the version artifact and where (github releases, pypi, the repo itself, etc)?
Thanks in advance, Anna
Hey @AnnaRevutsky , sure! I'd be happy to guide you.
So basically right now, when releasing a version you have to do this in order:
- bump the package's version in
pyproject.toml - run
uv sync - commit the
pyproject.tomlanduv.lockfiles - create a new tag + release via Github (only maintainers can do that)
- the Github Action will run and publish it to PyPi
So, instead it would be better if pyproject.toml, and the package's init.py are not hardcoding any version, and are taking it from the git tag when a release is created.
setuptools_scm is supposed to allow this kind of CI workflow.
Does that make sense?
Hey @shahar4499, could you please review the changed files?
Thank you.