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

modulefinder: use only dirs containing no __init__.py as namespace package #7108

Merged
merged 3 commits into from Jul 3, 2019

Conversation

@awelzel
Copy link
Contributor

commented Jun 30, 2019

When used with --namespace-packages, a directory containing no __init__.pyi
was previously added as a candidate to near_misses even if it contained
a __init__.py. This logic doesn't seem sensible, particularly as this
directory was then chosen as the result of find_module() instead of
the __init__.py inside the directory.

This should cure #5854.

awelzel added some commits Jun 30, 2019

modulefinder: use only dirs containing no __init__.py as namespace pa…
…ckage

When used with --namespace-packages, a directory containing no __init__.pyi
was previously added as a candidate to near_misses even if it contained
a __init__.py. This logic doesn't seem sensible, particularly as this
directory was then chosen as the result of find_module() instead of
the __init__.py inside the directory.

This should cure #5854.
tests/modulefinder: tests for FindModuleCache.find_module()
Those tests go hand in hand with the directory structure that was
created in test-data/packages/modulefinder.
Arne Welzel
testmodulefinder: rename pkg{4,5} to pkg{1,2}
...and some more explaining comments.

@awelzel awelzel force-pushed the awelzel:namespace-package-init branch from 3dd8ffd to 6a4cab9 Jul 1, 2019

@awelzel awelzel referenced this pull request Jul 3, 2019

Closed

Release 0.720 planning #7137

@gvanrossum gvanrossum self-requested a review Jul 3, 2019

@gvanrossum
Copy link
Member

left a comment

Yes, this looks right. Thanks for finding and fixing this bug!

@gvanrossum gvanrossum merged commit b724cca into python:master Jul 3, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.