Skip to content

set origin= for distutils.__spec__#2990

Merged
jaraco merged 2 commits into
pypa:mainfrom
asottile:distutils-hack-set-origin
Jan 8, 2022
Merged

set origin= for distutils.__spec__#2990
jaraco merged 2 commits into
pypa:mainfrom
asottile:distutils-hack-set-origin

Conversation

@asottile

@asottile asottile commented Dec 31, 2021

Copy link
Copy Markdown
Contributor

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

jaraco commented Jan 8, 2022

Copy link
Copy Markdown
Member

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

jaraco commented Jan 8, 2022

Copy link
Copy Markdown
Member

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