Repository navigation
Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
theodorbadea
left a comment
There was a problem hiding this comment.
Right now this PR is a mix of both VERSION and Tags and stores the version in two places. Perhaps the issue description and our later discussion may have been confusing. So maybe we should answer to the question Tags or VERSION?
| # waiting. Merges that land close together can therefore share one version. No change is lost: a tag always holds | ||
| # everything that was in main when it was made. | ||
| # | ||
| # The newest tag vX.Y.Z is the reference, not the content of VERSION, so a stale VERSION (for example the wrong side of |
There was a problem hiding this comment.
Do not think a merge conflict should ever be possible on the VERSION. Probably the only scenario would be if you try to merge a PR which is based on an outdated hashcommit of main.
There was a problem hiding this comment.
I agree: let's use tags with setuptools-scm. I said VERSION was ok in #232, but this PR shows that it costs more than I expected.
|
MLCommons CLA bot: All contributors are covered by the MLCommons CLA ✍️ ✅ |
7992a6a to
a545985
Compare
| # | ||
| # The bump commit goes straight to main, which needs a token that may bypass the rule that asks for pull requests. | ||
| # Add a repository secret VERSION_BUMP_TOKEN (a GitHub App token or a PAT with contents:write) and let it bypass. | ||
| # With the default GITHUB_TOKEN the push is refused while main is protected. |
There was a problem hiding this comment.
These 3 lines could be replaced by "The bump commit goes straight to main, so uses VERSION_BUMP_TOKEN to bypass the rule asking for pull requests.". Most of their content right now is the LLM giving guidelines about how to set up the bump workflow and should not end up as code comment.
| [tool.uv] | ||
| default-groups = ["dev"] | ||
| # Rebuild the package, and so the generated *_pb2.py files, when a .proto file changes. The default keys miss it. | ||
| # chakra is a real package (it holds __version__), and the default editable finder cannot resolve chakra.src.* under it. |
There was a problem hiding this comment.
This "chakra is a real package" phrasing is strange.
| # chakra is a real package (it holds __version__), and the default editable finder cannot resolve chakra.src.* under it. | ||
| # strict links the files into a tree that has the same layout as the wheel. | ||
| config-settings = { editable_mode = "strict" } | ||
| # Rebuild the package, and so the generated *_pb2.py files, when a .proto file changes, and so that a new module is |
There was a problem hiding this comment.
these will probably require a careful rebasing after the proto PR#282.
| group: version-bump | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: |
There was a problem hiding this comment.
this job should run only in this repo, not in the forks so probably needs something like if: github.repository == 'mlcommons/chakra'
There was a problem hiding this comment.
otherwise forks syncing will become merges isntead of fast forwards i think
theodorbadea
left a comment
There was a problem hiding this comment.
My vote still goes for tags and labels for minor and major bumps.
Summary
The version was hard-coded as
1.0.0, which PyPI already has. It now lives inVERSIONand goes up by itselfafter each merge to
main. Publishing to PyPI is not in this PR.Changes
VERSION(1.0.1) is the only place that holds the version.pyproject.tomlreads it.chakra.__version__comes from the installed metadata. For that,chakrabecomes a regular package(
src/chakra_pkg/__init__.py). The default editable install cannot findchakra.src.*under a regular package,so
[tool.uv]setseditable_mode = "strict". When the package is not installed,__version__is0+unknown.cache-keysin[tool.uv]also listssrc/**/*.pyandVERSION, so a new module is linked into the stricteditable tree and a version change rebuilds the package.
.github/workflows/version_bump.ymlruns on every push tomain. The reference is thehighest
VERSIONthatmainhas held before its tip:VERSIONabove it was set by a maintainer (a minor or major step) and stays as it is;main.Contributors work on forks, where a bot cannot push to the branch, so the bump happens after the merge.
scripts/wheel_check.shalso checks that the wheel METADATA version andchakra.__version__equalVERSION.Every Python call in it now runs with
-I, so a stale*.egg-infoin the repository root cannot win over thewheel that is being checked.
tests/test_tooling.pyruns the editable install withcwdset to the repository root, becauseuv piptakeseditable_modefrom thepyproject.tomlof the working directory.Needed from an admin
The bump commit goes straight to
main: add aVERSION_BUMP_TOKENsecret (GitHub App or PAT withcontents: write) and let it bypass the pull request rule. Without it the workflow fails.Testing
just gate: passes (ruff, vulture, shellcheck, pyright, 183 tests, slow tests, proto smoke, wheel check).python_tests.yml,end_to_end_tests.ymlandcheck_clean_install.shpass in a cleanenvironment, on Python 3.11 to 3.14.
chakra.__version__is1.0.1on all four.version_bump.ymlpassesactionlint, and a simulation on a local remote (34 checks). It has not run onGitHub.
Closes #232