Conversation
|
Travis is failing because when running with Python 3, there is a |
|
Travis uses virtualenvs for each Python version. Since you call raw virtualenv -p /usr/bin/python2 py2
alias python2=$PWD"/py2/bin/python2"
python2 -m pip install -U typingI checked this process and I believe it should work if mypy can deal with the slightly strange python2 install. My main concern with this process is that it is a bit of a hack, and the added overhead of starting a new virtualenv. I also have not tested this on travis itself. |
|
Another option would be to use the |
|
I just read through everything, LGTM. 👍 |
|
Looks like this change doesn't slow down Travis: run time for this PR is about the same as for other recent PRs. |
|
W00t! This has been on my list for a long time. Thanks for figuring out how to make it work and documenting it. |
Related to python/mypy#3337.
* master: (23 commits) Make return type of open() more precise (python#3477) Add test cases that delete a file during incremental checking (python#3461) Parse each format-string component separately (python#3390) Don't warn about returning Any if it is a proper subtype of the return type (python#3473) Add __setattr__ support (python#3451) Remove bundled lib-typing (python#3337) Move version of extensions to post-release (python#3348) Fix None slice bounds with strict-optional (python#3445) Allow NewType subclassing NewType. (python#3465) Add console scripts (python#3074) Fix 'variance' label. Change label for variance section to just 'variance' (python#3429) Better error message for invalid package names passed to mypy (python#3447) Fix last character cut in html-report if file does not end with newline (python#3466) Print pytest output as it happens (python#3463) Add mypy roadmap (python#3460) Add flag to avoid interpreting arguments with a default of None as Optional (python#3248) Add type checking plugin support for functions (python#3299) Mismatch of inferred type and return type note (python#3428) Sync typeshed (python#3449) ...
This gets rid of code duplication and makes sure mypy works with the released version of typing. This doesn't fix any immediate issue, but I saw some comments in the bug tracker saying that we should be able to get rid of lib-typing eventually.
There is a major downside: To run mypy tests locally, you will now have to have a Python 2.7 installed that has
typingavailable. If that's not acceptable, we're probably better off just keeping lib-typing as is.