Skip to content

[Build] Use setuptools_scm to allow git as the SSOT for package version #38

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

Open
shahar4499 opened this issue Apr 7, 2025 · 3 comments
Labels
devops Infra related stuff good first issue Good for newcomers

Comments

@shahar4499
Copy link
Contributor

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.

@shahar4499 shahar4499 assigned shahar4499 and unassigned shahar4499 Apr 7, 2025
@shahar4499 shahar4499 added enhancement New feature or request good first issue Good for newcomers devops Infra related stuff and removed enhancement New feature or request labels Apr 7, 2025
@AnnaRevutsky
Copy link

Hi! May I work on this issue?

@AnnaRevutsky
Copy link

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

@shahar4499
Copy link
Contributor Author

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:

  1. bump the package's version in pyproject.toml
  2. run uv sync
  3. commit the pyproject.toml and uv.lock files
  4. create a new tag + release via Github (only maintainers can do that)
  5. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Infra related stuff good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants