witty-crayon-22786
05/06/2020, 11:08 PMpython ./pex
in favor of #!/env/please/just/any python*
aloof-angle-91616
05/06/2020, 11:09 PMhundreds-father-404
05/06/2020, 11:10 PMpython3.7+
. You can either gamble on python3
or settle for python3.7
.
I don’t think you can say python3.7
or python3.8
in a shebangwide-energy-11069
05/06/2020, 11:10 PMTypeError: unhashable type: 'list'
witty-crayon-22786
05/06/2020, 11:11 PMaloof-angle-91616
05/06/2020, 11:11 PMwitty-crayon-22786
05/06/2020, 11:11 PMaloof-angle-91616
05/06/2020, 11:12 PMenough-analyst-54434
05/06/2020, 11:50 PM/usr/bin/env python
- no prefix and interpreter-constraints will force pex to re-exec itself after finding an appropriate interpreter no matter how its run.hundreds-father-404
05/06/2020, 11:51 PMpython3
, not python
. A user doesn’t have python
on their ubuntu machineenough-analyst-54434
05/06/2020, 11:51 PMpython file.pex
does is override the shebang./usr/bin/env python3
?aloof-angle-91616
05/06/2020, 11:53 PMpython
available on the user's PATH in this case was named python3
. we believe this is the case in ubuntu docker imagespython
executable and looks it up in the PATH when creating a pex file in v2enough-analyst-54434
05/06/2020, 11:54 PMhundreds-father-404
05/06/2020, 11:54 PMhermetic_pex.py
to work with either python
or python3
in the line argv=[python, ./example.pex]
, so that Pants can support that user today who only has python3
on his machine and not python
.
I don’t think that’s very feasible, though, without gymnastics, and I don’t think it’s a problem worth prioritizing. For now, we can improve documentationenough-analyst-54434
05/06/2020, 11:55 PMaloof-angle-91616
05/06/2020, 11:55 PM/usr/bin/env
shebang as discussed, is it possible we could remove the python
entirely? cc @hundreds-father-404pex
executable is not user-controlledenough-analyst-54434
05/06/2020, 11:56 PMaloof-angle-91616
05/06/2020, 11:56 PMAll that does is move the same problem into the shebang.yes, you're right. thanks
--python-setup-python-interpreter-name
option?enough-analyst-54434
05/06/2020, 11:57 PMwe believe this is the case in ubuntu docker imagesDid anybody check this?
aloof-angle-91616
05/06/2020, 11:58 PMhundreds-father-404
05/06/2020, 11:58 PMDid anybody check this?I don’t think it’s true in general. For example, we use Ubuntu in our own CI. @aloof-angle-91616 the user said he has a very custom docker image
aloof-angle-91616
05/06/2020, 11:58 PMwitty-crayon-22786
05/06/2020, 11:59 PMaloof-angle-91616
05/06/2020, 11:59 PMpython
package installs a py2 interpreter with the name python
witty-crayon-22786
05/06/2020, 11:59 PMaloof-angle-91616
05/06/2020, 11:59 PMwitty-crayon-22786
05/07/2020, 12:00 AMpex
, but that’s sortof what a shebang ishundreds-father-404
05/07/2020, 12:00 AMwould you accept a PR to add a --python-setup-python-interpreter-name option?I think this is good? Better than our current remedy we gave the user of needing to coerce their system to have
python
be discoverable. I don’t see any issues with this.aloof-angle-91616
05/07/2020, 12:00 AMenough-analyst-54434
05/07/2020, 12:01 AMaloof-angle-91616
05/07/2020, 12:01 AMenough-analyst-54434
05/07/2020, 12:01 AMaloof-angle-91616
05/07/2020, 12:01 AMln -s
if the user doesn't have a python
-named binary tooenough-analyst-54434
05/07/2020, 12:02 AMaloof-angle-91616
05/07/2020, 12:02 AMBut should not be if this is a truly wierd case.sorry, i meant that using the PATH to locate the first
python
is itself a form of configuration, which removes the need for a separate optionpython
interpreter or symlink"enough-analyst-54434
05/07/2020, 12:04 AMpython
binary in addition to python3.6
etc is also a requirement.aloof-angle-91616
05/07/2020, 12:05 AMhundreds-father-404
05/07/2020, 12:05 AMenough-analyst-54434
05/07/2020, 12:05 AMaloof-angle-91616
05/07/2020, 12:06 AMhundreds-father-404
05/07/2020, 12:09 AMlet me know if there’s anything i can help clean up hereA review would be appreciated! Everything is done other than: - aws lambda - coverage - “project introspection” to describe things like
dependees
See https://pants.readme.io/docs/welcome-to-pants for 1.28.x, including a new page on codegen I wrote today :)aloof-angle-91616
05/07/2020, 12:10 AMhundreds-father-404
05/07/2020, 12:12 AMenough-analyst-54434
05/07/2020, 12:34 AMpython
is on the PATH
and you also have python3.[6-9]
on the PATH
(setup script needs this). So we actually have a push-pull. If the user's image would have had just a python
binary for python3.6 then the setup script would fail.python
on the path can be 2.7+hundreds-father-404
05/07/2020, 1:22 AMpython3.9
because we will soon stop using abi3
(to unblock Stu’s migration from cffi -> cpython
), and we won’t initially build py39enough-analyst-54434
05/07/2020, 1:35 AMPATH
. This can be Python 2 or Python 3." should be "You must also have python on your PATH
. This can be Python 2.7+ or Python 3.5+." That said, the only important thing is Python 3.6+ on the PATH
and all the rest of the lanuage applies to weird situations. How about de-escalating the weird situation from the main flow of the section. Something like:
--
To run Pants, you need:
* Linux or macOS.
* Python 3.6+ discoverable on your PATH
Note that your own code can use Python 2; this is only what Pants uses to run itself.
If you run into problems but have Python 3.6+ installed you may have a
non-standard python installation. Pants expects to find both python
and one of python3.6
, python3.7
, or python3.8
on your PATH.hundreds-father-404
05/07/2020, 1:36 AMenough-analyst-54434
05/07/2020, 1:45 AM