Use setuptools_scm versioning - #490
Conversation
…documented pattern
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #490 +/- ##
=======================================
Coverage 54.22% 54.22%
=======================================
Files 1 1
Lines 225 225
=======================================
Hits 122 122
Misses 103 103 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This looks cool, I have a few (naive?) questions for now, as I try to understand the process:
|
Yes, it's to checkout the repo with tags under GHA using the checkout action.
If you are referring to the versioning scheme, it is for guessing what the version should be if it is not a tagged commit. For releases this should not matter since we only build on tags, but for local development (editable install for whatever reason, and for CI builds in a PR branch or on main post-merge) the version needs to be generated, and there are different ways of generating a new temporary non-released version. setuptools_scm has docs here and you can also test this out locally by invoking
It is doing two things. Note that we do not install the package into RTD when rendering the docs. So, first it must figure out the version to embed into Sphinx, and it does this via the
I mean that, in the conda-forge recipe here, the version is already available as a jinja variable so we do not need to re-derive it from the source tarball. Conveniently the GitHub tag triggers a PR on conda-forge and that tag metadata info travels with it, so it all works out. This is fundamentally changing how we version/package so it's good to talk about it and iron out the details. |
Purpose
Closes #446. I opted to using
setuptools_scmfor a few reasonsversioneervendors some Python code that does this logic at import time which seems way too fragilesetuptools_scmis used >20x more thanversioneeron conda-forge based on search hitsbump-my-versionis a lot more manual IMO - the tag no longer becomes a single source of truthWe will have to adjust some stuff with conda-forge once this is merged, but this should work as-is. A few things to note:
guess-next-dev, feel free to suggest alternatives, I have usedpost-releasebefore. I don't think this ultimately matters since 99% of people should be using a tagged release, but for those that want traceability in a dev env this may matterWe can use this PR to iterate on this design, and if we like it we can mirror the approach elsewhere in the org. Some extra work was needed here to interface it to
meson-python, standard integration withsetuptoolsis trivial since this tool is called....setuptools_scmso it works out of the box.Expected time until merged
Not urgent.
Type of change
Testing
Checklist
ruff checkandruff formatto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable