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

Better error on empty typeshed directory #3862

Merged
merged 4 commits into from Aug 24, 2017

Conversation

Projects
None yet
2 participants
@ethanhs
Collaborator

ethanhs commented Aug 22, 2017

If typeshed is empty (someone forgot to pull the submodule, or the install is broken) the path to typeshed will resolve correctly, but of course stubs will not be found. I added an assert to catch this case. In addition, I realized that before when analyzing 2.7 code, it would look for subdirectories of the typeshed directory for 2.0-2.6, which is pointless, so I modified it to only look in the 2.7 subdirectory.

Better error on empty typeshed directory
In addition, mypy now only looks in typeshed/2.7 and no longer looks for
2.6-2.0
Show outdated Hide outdated mypy/build.py
Show outdated Hide outdated mypy/build.py
print() error and exit, check only 3.3+ folders
Instead of using an assert, we check if it is empty, print an error out
to sys.stderr, and exit with return 1, so that users will read the error
message. Also, we only need to check for folders that exist, thus 3.3 is
the minimum.
@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs Aug 23, 2017

Collaborator

I addressed the two pieces of feedback so this is ready for review again @gvanrossum

Collaborator

ethanhs commented Aug 23, 2017

I addressed the two pieces of feedback so this is ready for review again @gvanrossum

Show outdated Hide outdated mypy/build.py

ethanhs and others added some commits Aug 24, 2017

Global variable for PYTHON3_VERSION_MIN
To avoid magic constants, and make updating minimum version fewer
changes, introduce a global constant for the minimum Python 3 version
supported.
Delete outdated comment.
I see no point in calling out that we don't "really" support 3.0 and 3.1.

@gvanrossum gvanrossum merged commit df95527 into python:master Aug 24, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gvanrossum

This comment has been minimized.

Show comment
Hide comment
@gvanrossum

gvanrossum Aug 24, 2017

Member

Thanks!

Member

gvanrossum commented Aug 24, 2017

Thanks!

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs Aug 24, 2017

Collaborator

My pleasure! I'll look through things and see if there is anywhere else that could use the minimum Python version global.

Collaborator

ethanhs commented Aug 24, 2017

My pleasure! I'll look through things and see if there is anywhere else that could use the minimum Python version global.

@ethanhs ethanhs deleted the ethanhs:typeshed-search-fixes branch Aug 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment