You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The behavior of mypy with regard to Python 2.7 tests is inconsistent. On the one hand, if no Python 2.7 interpreter can be found at all, https://github.com/python/mypy/blob/master/mypy/util.py#L66 will return None and mypy will happily skip the Py2 tests. But if a Python 2.7 interpreter is found, but is missing the typing backport (which mypy no longer bundles), mypy will go ahead and run the Py2 tests and they will fail.
Our build boxes are in the midst of an upgrade from an OS version with Python 2.6 as system Python to one with Python 2.7. On the older OS, mypy builds fine and just skips the Py2 tests (which is fine). On the newer OS, it finds the system Python 2.7 and those tests fail for lack of typing. It'sdifficult for us to install the typing module into the system Python on these hosts.
I propose that it would be more consistent if mypy considers "no Python 2.7 with typing available" equivalent to "no Python 2.7 available" and skips the Py2 tests. It would be quite easy to add a python -c "import typing" check to try_find_python2_interpreter. I can submit a PR for this, if the idea is approved.
The text was updated successfully, but these errors were encountered:
Actually, this specific issue will no longer be a problem if #4025 is merged as-is. We will no longer require the runtime typing to be there. Furthermore, that change should remove our dependency on a runtime Python 2 all together, as we don't test evaluation of Python anymore.
It wasn't totally clear to me with ongoing discussion on #4025 whether the final result there would take care of this or not, so I went ahead and submitted #4041, which fixes it.
The behavior of mypy with regard to Python 2.7 tests is inconsistent. On the one hand, if no Python 2.7 interpreter can be found at all, https://github.com/python/mypy/blob/master/mypy/util.py#L66 will return
None
and mypy will happily skip the Py2 tests. But if a Python 2.7 interpreter is found, but is missing thetyping
backport (which mypy no longer bundles), mypy will go ahead and run the Py2 tests and they will fail.Our build boxes are in the midst of an upgrade from an OS version with Python 2.6 as system Python to one with Python 2.7. On the older OS, mypy builds fine and just skips the Py2 tests (which is fine). On the newer OS, it finds the system Python 2.7 and those tests fail for lack of
typing
. It'sdifficult for us to install thetyping
module into the system Python on these hosts.I propose that it would be more consistent if mypy considers "no Python 2.7 with typing available" equivalent to "no Python 2.7 available" and skips the Py2 tests. It would be quite easy to add a
python -c "import typing"
check totry_find_python2_interpreter
. I can submit a PR for this, if the idea is approved.The text was updated successfully, but these errors were encountered: