what is the relationship of mypy to that error?
# pex
a
what is the relationship of mypy to that error?
h
It looks like a type error. We’re expecting a PythonINterpreter object, but have a tuple. MyPy is designed to catch things like that.
🔥 1
a
oh hell yeah
h
I can’t figure out how this is happening, though. The code all looks right
a
i can take a look later today but it does sound like mypy purely as a linter might be able to help.
h
Yeah we’d have to use type comments. Until we decide to allow Pex to drop Python 2 support (Iiuc, Pex would still be able to run Python 2. You just need a Python 3 interpreter to run the tool)
a
yes that’s what pip does it’s not awful
h
Yeah it seems pretty rare that you can’t find a Python 3.5+ interpreter in your environment anymore. But Pex does need to maintain support for building Py2, of course
a
yes type comments are very effective and mypy is just as easy to run via tox in py2 as py3. the vendored pip source has examples of how to encode some of the patterns such as ImportError checking which mypy still doesn’t attempt to handle specially
👍 1
h
I think I’d rather push for us to start requiring Python 3, though. I think it would do a lot to lower the barrier to entry to contributing to Pex. * No more cognitive load of if both Py2 and Py3 working. * Normal type annotations are very nice to understand what’s going on.
a
yes. i’m not sure what the larger strategy is (i assume there is one) and how/why users still need python 2, or whether we could address those needs without keeping pex in the past.
👍 1