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
{{ message }}
Repository navigation
Improve test coverage of the Python2 bits of mypy #732
Since Python2 support is now a lot, and none of the stubs are being checked at all, the priority of this has gone up in my eyes, though likely it will still go after typeshed for sanity reasons.
Plan:
Backport the minimal bits of mypy.syntax.dialect (i.e. not the lexer differentiation, but yes the future stuff) and use it.
Should this include the third number? I didn't need, but typeshed says it should be supported.
Likely we want to add variant-pypy and variant-jython futures (note that '-' is not valid in real future names so we can't collide).
I do think we should be testing on Pypy.
When checking a .pyi file, add the mypy-codec future automatically.
Read a new environment variable MYPY_PYTHON, which takes the name of an executable. If unset, use the currently-running python instead. The --py2 option will try to run the first of python2, python2.7, python until it finds a suitable python executable.
If running under pypy3, should we prepend pypy2, pypy?
Call that executable and extract sys.path (to find stubs properly) and sys.version_info (to construct the Dialect object which should then be used everywhere)
Also use it in place of the current logic in testpythoneval.
On travis, export MYPY_PYTHON=python and then start the driver with python3.
The driver needs to learn to select the right set of tests for the current MYPY_PYTHON.
Activity
JukkaL commentedon Aug 4, 2015
Sounds good! The current travis setup is clearly not optimal.
Try harder to find a Python 2 interpreter
o11c commentedon Oct 1, 2015
Since Python2 support is now a lot, and none of the stubs are being checked at all, the priority of this has gone up in my eyes, though likely it will still go after typeshed for sanity reasons.
Plan:
mypy.syntax.dialect(i.e. not the lexer differentiation, but yes the future stuff) and use it.variant-pypyandvariant-jythonfutures (note that'-'is not valid in real future names so we can't collide)..pyifile, add themypy-codecfuture automatically.MYPY_PYTHON, which takes the name of an executable. If unset, use the currently-running python instead. The--py2option will try to run the first ofpython2,python2.7,pythonuntil it finds a suitable python executable.pypy2,pypy?sys.path(to find stubs properly) andsys.version_info(to construct theDialectobject which should then be used everywhere)testpythoneval.export MYPY_PYTHON=pythonand then start the driver withpython3.MYPY_PYTHON.