benley / bazel_rules_pex

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

Better support of different python versions #45

Closed mouadino closed 7 years ago

mouadino commented 7 years ago

As described in issue #44, setting pex_binary's interpreter parameter to python3 isn't enough, b/c the pex_wrapper will use the same python version that was used to build pex_wrapper.pex, which is the same as the host machine /usr/bin/env python. To fix this, we can use PEX_PYTHON environment variable, which force pex to run pex_wrapper.pex to the specified version pointed by that environment variable.