aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Wickman <wick...@apache.org>
Subject Re: override python interpreter when building pex using pants
Date Tue, 02 Dec 2014 18:23:44 GMT
You can use ./pants build -i <interpreter> <target> to build with a
specific interpreter, but it will still revert to a #!/usr/bin/env
pythonX.X hashbang line.  There is not yet a pants environment variable to
switch interpreters at runtime but it would be a straightforward feature to
add.  I've filed https://github.com/pantsbuild/pex/issues/27

As a workaround, I *think* you can use -thermos_executor_path in the
scheduler to just do:

-thermos_executor_path="/my/custom/python/bin/python2.7
/usr/local/bin/thermos_executor"

or whatever the path to the executor is, since pex files can be invoked as
ordinary python scripts.  If for whatever reason Aurora doesn't like the
space there, you can always just create a wrapper e.g.
/usr/local/bin/thermos_executor.sh that just contains the same.

~brian

On Tue, Dec 2, 2014 at 8:20 AM, Bhuvan Arumugam <bhuvan@apache.org> wrote:

> It's more of pants/pex question.
>
> I've installed python2.7 in a custom path. I want to build
> aurora_client using this interpreter. By default, it use python2.7 in
> the PATH (#!/usr/bin/env python2.7). How do I change it to use
> python2.7 in custom path? pex support this feature with --interpreter
> option, but pants dont seem to expose it.
>
> IOW, the first line of pex is #!/usr/bin/env python2.7; i want to
> change it as #!/my/custom/python/bin/python2.7.
>
> The current workaround is to add /my/custom/python/bin to PATH
> everytime we execute pex. It's not feasible with thermos_executor.
> It's launched from mesos-slave, unless i fix mesos-slave to expose
> /my/custom/python/bin in PATH, i can't launch thermos_executor.
>
> Is there a workaround? Is there any undocumented pants env that can
> help to override the interpreter?
>
> --
> Regards,
> Bhuvan Arumugam
> www.livecipher.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message