Skip to content

fix(pylock): add PylockSelectError to __all__ - #1202

Merged
henryiii merged 1 commit into
pypa:mainfrom
r266-tech:oss-pylock-select-error-export-1092
May 29, 2026
Merged

henryiii merged 1 commit into
pypa:mainfrom
r266-tech:oss-pylock-select-error-export-1092

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

PylockSelectError is defined in src/packaging/pylock.py:313 (base exception for Pylock.select errors with _DefaultSelectionError, _AmbiguousMatchError, _NoMatchError subclasses) and is publicly documented in docs/pylock.rst (.. autoexception:: PylockSelectError, alongside the other Pylock exceptions). Its sibling base exceptions are both already in packaging.pylock.__all__:

  • PylockValidationError — base, has subclass _PylockRequiredKeyError, also subclassed by PylockUnsupportedVersionError
  • PylockUnsupportedVersionError — derives from PylockValidationError

Adding "PylockSelectError" to __all__ (alphabetically between Pylock and PylockUnsupportedVersionError) makes the export surface consistent with the docs and with the established sibling pattern: documented base exceptions go in __all__. Star-imports (from packaging.pylock import *) then expose the three Pylock exceptions uniformly, and downstream introspection (type-stub generation, doc tooling, error-handler scaffolds) sees a uniform shape.

Single-line change. No behavioral change.

@brettcannon
brettcannon requested a review from sbidoul May 28, 2026 19:03

@sbidoul sbidoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That exception is indeed meant to be public.

The PR description could have been one line too, but 🤷 I guess.

@henryiii

Copy link
Copy Markdown
Contributor

Even the branch name is longer than the change. :)

Thanks!

@henryiii
henryiii force-pushed the oss-pylock-select-error-export-1092 branch from 118f062 to 606367e Compare May 29, 2026 13:33
@henryiii
henryiii enabled auto-merge (squash) May 29, 2026 13:34
@henryiii
henryiii force-pushed the oss-pylock-select-error-export-1092 branch from 606367e to d3879db Compare May 29, 2026 14:11
@henryiii
henryiii merged commit cf5dc92 into pypa:main May 29, 2026
58 checks passed
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