Skip to content

✨ feat(api): expose MissingExtraError for public imports - #9

Merged
gaborbernat merged 2 commits into
mainfrom
draft/private-import-adoption
Nov 10, 2026
Merged

gaborbernat merged 2 commits into
mainfrom
draft/private-import-adoption

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

This draft tests adoption of simplint's proposed private import rule in python-sbom. Imports of package errors now use the public API, reducing local SMP310 findings from 254 to 217. Callers can use from python_sbom import MissingExtraError when handling a missing optional dependency.

The package API already exports SbomError and now exports MissingExtraError as well. Internal consumers and tests import both there, while the remaining findings concern other private modules and require separate API decisions. The new exception export is documented and recorded in the changelog.

Callers can catch the optional-dependency error through the package API.
Use that API throughout the project to avoid absolute private imports.
@gaborbernat gaborbernat added the enhancement New feature or request label Nov 9, 2026
Exporting the exception makes its meaning part of the public API. Document
when callers receive it.
@gaborbernat
gaborbernat marked this pull request as ready for review November 10, 2026 05:14
@gaborbernat
gaborbernat merged commit b097542 into main Nov 10, 2026
37 checks passed
@gaborbernat
gaborbernat deleted the draft/private-import-adoption branch November 10, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant