Skip to content

Bump packaging >= 26.1#1310

Merged
woodruffw merged 2 commits intomainfrom
ww/suppress-lint
Apr 17, 2026
Merged

Bump packaging >= 26.1#1310
woodruffw merged 2 commits intomainfrom
ww/suppress-lint

Conversation

@woodruffw
Copy link
Copy Markdown
Member

@woodruffw woodruffw commented Apr 17, 2026

This is tripping the CI in #1309 and on main.

packaging==26.1 moves packaging.metadata.ExceptionGroup to packaging.errors.ExceptionGroup, but re-exports that API through packaging.metadata for backwards compatibility. However, that re-export isn't explicitly marked in __all__, so mypy flags it.

We could patch around this or suppress it, but bumping to >= 26.1 is easiest.

Here's the implicit re-export:

https://github.com/pypa/packaging/blob/b82413d6a1e5037b65aabc44154a97f0b2d63766/src/packaging/metadata.py#L21

CC @henryiii for opinions since I think packaging.errors was your change with pypa/packaging#1071 🙂

Signed-off-by: William Woodruff <william@astral.sh>
Copy link
Copy Markdown
Member

@sigmavirus24 sigmavirus24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we bump the minimum packaging version to not encounter this and clean things up instead of adding the mypy ignore?

@woodruffw
Copy link
Copy Markdown
Member Author

woodruffw commented Apr 17, 2026

What if we bump the minimum packaging version to not encounter this and clean things up instead of adding the mypy ignore?

That works for me! That'll be a big bump in terms of downstream integrators (since right now we test packaging==24 as a supported variant, but I think it's good to nudge integrators to stay closer to the newer edge of PyPA tooling 🙂

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw changed the title Suppress a mypy re-export lint Bump packaging >= 26.1 Apr 17, 2026
@henryiii
Copy link
Copy Markdown
Contributor

We can add it to __all__ for 26.2. Might be nice to for a release or two to give users a chance to move before seeing mypy warnings, or to help keep it easy to maintain older versions too.

@woodruffw woodruffw merged commit cab618f into main Apr 17, 2026
23 checks passed
@woodruffw woodruffw deleted the ww/suppress-lint branch April 17, 2026 20:07
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.

3 participants