Skip to content

refactor: Split exceptions into a package#14176

Open
ichard26 wants to merge 7 commits into
pypa:mainfrom
ichard26:errors/refactor
Open

refactor: Split exceptions into a package#14176
ichard26 wants to merge 7 commits into
pypa:mainfrom
ichard26:errors/refactor

Conversation

@ichard26

Copy link
Copy Markdown
Member

I'm planning to add even more diagnostic errors, but exceptions.py is starting to become unwieldy. I've converted it into a package to permit for further growth. To start, I've moved the following exceptions to their own submodules.

Group Exceptions moved
pyproject MissingPyProjectBuildRequires, InvalidPyProjectBuildRequires
wheel InvalidWheelFilename, UnsupportedWheel, InvalidWheel
hashes HashErrors, HashError, VcsHashUnsupported, DirectoryUrlHashUnsupported, HashMissing, HashUnpinned, HashMismatch
uninstall UninstallMissingRecord, LegacyDistutilsInstall
build_env BuildDependencyInstallError, VenvImportError, VenvCreationError
resolution ResolutionTooDeepError
network NetworkConnectionError, ConnectionFailedError, ConnectionTimeoutError, SSLMissingError, SSLVerificationError, ProxyConnectionError, IncompleteDownloadError

I've left the remaining exceptions alone in exceptions/__init__.py. I'm happy to hear suggestions for more groupings.

In the near-to-medium future, I'm planning to add new diagnostic errors to wheel and resolution.

Tip

This is probably much easier to review commit-by-commit.

@ichard26 ichard26 added skip news Does not need a NEWS file entry (eg: trivial changes) skip PR template check Silence the PR template check in CI labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news Does not need a NEWS file entry (eg: trivial changes) skip PR template check Silence the PR template check in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant