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

Support recursive traversal into PEP 420 namespace packages #7219

Merged
merged 1 commit into from Jul 18, 2019

Conversation

@warsaw
Copy link
Member

commented Jul 15, 2019

E.g. with this file layout:

src/
    anamespace/
        foo/
            __init__.py
            bar.py

running

$ MYPYPATH=src mypy -p foo --namespace-packages

will traverse into src/anamespace/foo

Closes #6989

warsaw added a commit to warsaw/pygradle that referenced this pull request Jul 16, 2019
If and when python/mypy#7219 lands, we will have the
ability to tell mypy to traverse into PEP 420 namespace packages.  In order to
preserve backward compatibility, the MypyExtension now allows clients to set
the mypy command line arguments, but if they don't it will use the old command
line of just passing the source directory.
@warsaw

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2019

After internal testing, this does seem to do what I'm looking for.

One small semi-related gotcha: you can't seem to specify -p/--package in the mypy.ini or setup.cfg file.

@ilevkivskyi ilevkivskyi requested review from gvanrossum and msullivan Jul 17, 2019
E.g. with this file layout:

src/
    anamespace/
        foo/
            __init__.py
            bar.py

$ MYPYPATH=src mypy -p foo --namespace-packages

will traverse into src/anamespace/foo
@warsaw warsaw force-pushed the warsaw:issue6989 branch from 3198a9b to f0d3402 Jul 18, 2019
@ethanhs

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

I restarted the failed travis job, seems to have been an error on their end.

@warsaw

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2019

I wonder if appveyor is stuck?

@JelleZijlstra

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

It looks like it actually succeeded but didn't report success GitHub.

@warsaw

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2019

@JelleZijlstra Should I push another commit or is the status good enough to review (and hopefully merge :) this PR?

@JelleZijlstra

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

I think it should be fine but I won't be merging the PR, sorry.

Copy link
Collaborator

left a comment

This looks good to me!

@msullivan msullivan merged commit 404d5c9 into python:master Jul 18, 2019
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@warsaw warsaw deleted the warsaw:issue6989 branch Jul 19, 2019
@warsaw

This comment has been minimized.

Copy link
Member Author

commented Jul 19, 2019

Thanks! I look forward to the next release. I'll likely hot fix our internal version in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.