Skip to content

fix: Version bumping with packaging<26.0#2205

Open
bedlamzd wants to merge 2 commits intopypa:masterfrom
bedlamzd:fix-version-bump-old-packaging
Open

fix: Version bumping with packaging<26.0#2205
bedlamzd wants to merge 2 commits intopypa:masterfrom
bedlamzd:fix-version-bump-old-packaging

Conversation

@bedlamzd
Copy link
Copy Markdown

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", {})

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", {})`
@bedlamzd
Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant