-
Notifications
You must be signed in to change notification settings - Fork 157
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
(chore): Update version number inference in dev environments #1831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well now, and I think it's a bit cleaner that the example you linked to as well. As long as CI passes, should be good.
The example repo is intended to capture best practices around when you do that (i.e. you want to infer the version at runtime). I’ll send a PR that way to capture the plugin error like we do here. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1831 +/- ##
===========================================
+ Coverage 54.13% 83.69% +29.56%
===========================================
Files 40 41 +1
Lines 6268 6268
===========================================
+ Hits 3393 5246 +1853
+ Misses 2875 1022 -1853
|
… dev environments
…vironments (#1832) Co-authored-by: Philipp A <[email protected]>
this PR has two closely related bugfixes:
actually configure version inference correctly
Turns out I messed up in #1680 and put the config into the wrong section, disabling it. So this PR fixes that:
main
branch before this PR:(this is wrong as it’s <0.11.3 which is already released)
main
branch after this PR:moving that config value to the
tool.hatch.version
table makes build time versions work as expected (e.g.pip install -e .../anndata
in CI), but this PR also fixes a second problem:make the runtime version use our config
We follow “hatch-vcs-footgun-example”, which updated: maresb/hatch-vcs-footgun-example#4
By using
hatchling
APIs instead ofsetuptools_vcs
directly, we can make sure the config used by the runtime code is the same used at build time, i.e. in a dev environment,anndata.__version__
gets calculated in the same way as the version embedded in the metadata.