benley / bazel_rules_pex

Python PEX rules for Bazel
Apache License 2.0
39 stars 36 forks source link

pex_binary: Pass interpreter attribute as --python-shebang #61

Closed evanj closed 6 years ago

evanj commented 6 years ago

The pex_binary interpreter attribute is documented as "Path to the python interpreter the pex should to use in its shebang line." However, it was not being passed when building the PEX, so it did not take effect.

It is getting passed as PEX_PYTHON, which changes the interpreter used for that invocation of a given pex. This may have been a recent change: https://github.com/pantsbuild/pex/issues/53

interpreter_test.py: Add a test that reads the files and verifies that the interpreter is set correctly.

c4urself commented 6 years ago

Any reason why this isn't merged in? Just incorporated it a local copy today and works perfectly.

benley commented 6 years ago

Hrmmm. At some point we probably ought to transition to py_runtime for specifying python interpreters, but this looks like a good thing for now.