I think I asked before, but that was over 90 days ...
# general
I think I asked before, but that was over 90 days ago. Sorry for asking again. • Is there a way to specify which python interpreter to use for a virtualenv export? https://www.pantsbuild.org/docs/setting-up-an-ide#python-third-party-dependencies-and-tools • Is there a way to specify which resolve I want exported from the cli? I want to allow people to export tool venvs, but I don't need it in CI so I don't want to disable it in
. • Can I export the same resolve multiple times, each with a different python interpreter? Background: For st2 CI, I need one virtualenv for python 3.8 and another for python 3.6 (3.6 is ancient I know. updating that is a separate effort). I will use the exported virtualenvs instead of a Makefile managed venv for processes that have not yet been configured in pants. Eventually, I'll be able to stop using the exported virtualenv and just use pants for everything, but this should help to bridge that gap.
Oh sweet! Part of this is available in 2.15.0a1 https://github.com/pantsbuild/pants/pull/17461
So, I can use
./pants export --resolve=
in 2.15. That means it is so much closer to me being able to use it. I will probably wait for the first rc. But I'm glad this didn't wait till 2.16.
Now to figure out how to handle python interpreter specification (ala
I suppose I can override that at runtime with https://www.pantsbuild.org/v2.15/docs/reference-python-bootstrap#search_path And maybe create aliases venv-3.6, venv-3.8 that do
export --python-bootstrap-search-path=...
And for a future version of pants we could add some kind of interpreter selection option here: https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/python/goals/export.py#L92 This would be similar to
virtualenv -p
or `virtualenv --python`: https://virtualenv.pypa.io/en/latest/cli_interface.html#p