https://pantsbuild.org/ logo
#pex
Title
# pex
a

aloof-angle-91616

09/16/2020, 7:09 PM
what is the relationship of mypy to that error?
h

hundreds-father-404

09/16/2020, 7:11 PM
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

aloof-angle-91616

09/16/2020, 7:13 PM
oh hell yeah
h

hundreds-father-404

09/16/2020, 7:14 PM
I can’t figure out how this is happening, though. The code all looks right
a

aloof-angle-91616

09/16/2020, 7:17 PM
i can take a look later today but it does sound like mypy purely as a linter might be able to help.
h

hundreds-father-404

09/16/2020, 7:18 PM
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

aloof-angle-91616

09/16/2020, 7:20 PM
yes that’s what pip does it’s not awful
h

hundreds-father-404

09/16/2020, 7:21 PM
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

aloof-angle-91616

09/16/2020, 7:22 PM
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

hundreds-father-404

09/16/2020, 7:24 PM
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

aloof-angle-91616

09/16/2020, 7:26 PM
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