Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set origin= for distutils.__spec__ #2990

Merged
merged 2 commits into from
Jan 8, 2022
Merged

set origin= for distutils.__spec__ #2990

merged 2 commits into from
Jan 8, 2022

Conversation

asottile
Copy link
Contributor

@asottile asottile commented Dec 31, 2021

set origin so spec finding reports the correct location -- https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec

Summary of changes

Closes asottile/reorder-python-imports#210

Pull Request Checklist

@asottile asottile marked this pull request as ready for review December 31, 2021 17:50
@jaraco
Copy link
Member

jaraco commented Jan 8, 2022

Inferring from the bug report, the issue is that the DistutilsMetaFinder is creating a spec without a valid origin, creating a spec that is inferred to be a namespace package.

I might re-arrange the test a bit, but this is great. Thanks for the contrib.

@jaraco
Copy link
Member

jaraco commented Jan 8, 2022

I confirmed that 91ce77e captures the failed expectation when run with SETUPTOOLS_USE_DISTUTILS=local, which is run in CI, so I believe it to be a more selective and less entangled test.

@jaraco jaraco merged commit d514fa1 into pypa:main Jan 8, 2022
@asottile asottile deleted the distutils-hack-set-origin branch January 8, 2022 19:45
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.

issue due to setuptools
2 participants