Skip to content
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

packaging 22+ break PackagingSpecifierSet with extended version #773

Closed
gsemet opened this issue Jan 15, 2024 · 2 comments
Closed

packaging 22+ break PackagingSpecifierSet with extended version #773

gsemet opened this issue Jan 15, 2024 · 2 comments

Comments

@gsemet
Copy link

gsemet commented Jan 15, 2024

Was working with packaging 21.3:

SpecifierSet(f"<0.0.1.dev1+g3cdcc", prereleases=True)

In all versions since 22.0, we get:

packaging.specifiers.InvalidSpecifier: Invalid specifier: '<0.0.1.dev1+g3cdcc'

For me, 0.0.1.dev1+g3cdcc and 0.0.1.dev1 and equivalent so i do not understand why 0.0.1.dev1+g3cdcc is refused by SpecifierSet

@pradyunsg
Copy link
Member

Please see #530

@pradyunsg
Copy link
Member

pradyunsg commented Jan 15, 2024

Wait, I should elaborate.

In #530, there's discussion about why invalid inputs are now rejected by packaging. As for why this is invalid input, from the version specificiation for the operator being used:

Local version identifiers are NOT permitted in this version specifier.

So, the new behaviour here is correct. Further, packaging 21.3 returned a LegacySpecifier...

>>> list(SpecifierSet("<0.0.1.dev1+g3cdcc"))
[<LegacySpecifier('<0.0.1.dev1+g3cdcc')>]

... and packaging 21.3 also raises a warning when run in development mode.

❯ python -X dev -c "from packaging.specifiers import SpecifierSet; SpecifierSet('<0.0.1.dev1+g3cdcc')"
/Users/pradyunsg/Developer/github/pip/.venv/lib/python3.11/site-packages/packaging/specifiers.py:255: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
  warnings.warn(

Closing this out since the question asked has been answered, and I don't expect that we'd be changing behaviour here unless someone reckons this is worth doing a standard specification update for + drives that effort.

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

No branches or pull requests

2 participants