fix: Version bumping with packaging<26.0#2205
Open
bedlamzd wants to merge 2 commits intopypa:masterfrom
Open
Conversation
Since `packaging` 26.0, the way `Version` represented internally has changed.
With it changed the interface (more like internal implementation detail)
for how to update specific parts of the version
Namely `dev` and `post` were expected to be tuples like `("post", 0)` or
`None`, if not set. With new interface these can be set as plain
numbers
In bc31cfc there was an update to accommodate
the new interface, which missed the mismatch with the previous version, likely
due to noqa comments there
This resulted in:
- unable to bump to `.dev0` version
- unable to bump to `.post0` version
- error when bumping existing `dev`
- clearing existing `.post0` when adding `dev`
- error when bumping `dev` or `post` with existing `post`
To reproduce:
- checkout the first commit in the branch
- run `hatch test -i packaging_regression`
Alternatively:
- checkout latest stable version
- manually install `packaging` before version 26.0 (e.g. 24.2)
- run tests or `StandardScheme("", {}).update("dev", "0.1.0.dev", {})`
Author
|
btw, wasn't sure how to adapt tests for that, so feel free to discard that code and reuse anything in your own branch/PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
packaging26.0, the wayVersionrepresented internally has changed.With it changed the interface (more like internal implementation detail)
for how to update specific parts of the version
Namely
devandpostwere expected to be tuples like("post", 0)orNone, if not set. With new interface these can be set as plainnumbers
In bc31cfc there was an update to accommodate
the new interface, which missed the mismatch with the previous version, likely
due to noqa comments there
This resulted in:
.dev0version.post0versiondev.post0when addingdevdevorpostwith existingpostTo reproduce:
hatch test -i packaging_regressionAlternatively:
packagingbefore version 26.0 (e.g. 24.2)StandardScheme("", {}).update("dev", "0.1.0.dev", {})