Repository navigation
🐛 fix(provider): load each project's own copy - #5
Merged
Merged
Conversation
0.1.1 refused a provider module the process had imported from another project, which breaks a test suite that builds copies of one project, as virtualenv's does. The cached module and its submodules are now dropped so the project's own copy loads; a provider built earlier keeps the modules it references. git output is decoded as UTF-8 explicitly.
Documentation build overview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopting python-sbom in virtualenv broke 8 of its SBOM tests on 0.1.1. They build several copies of the project in one process, and each copy's
tasks.sbom_contentprovider was refused because the process had already imported that module from the previous copy. That refusal came from #2's fix for the case where a second project silently ran the first project's provider. The fix was right to stop the silent reuse, but refusing was too strict: a test suite, or any tool driving several hatch builds in one process, is a legitimate user. 🐛Loading is now scoped to the project instead. When the project provides a module that the import cache holds from somewhere else, the outermost such module is dropped with its submodules before the import, so the project's own copy loads. A provider built earlier keeps the module objects it already references, so its build is unaffected. With this branch installed, virtualenv's SBOM tests pass.
The git calls that read the source revision now decode output as UTF-8 explicitly, which silences the
EncodingWarningthatPYTHONWARNDEFAULTENCODINGsurfaced in virtualenv's sdist check.