Is it possible to `./pants export --symlink-python...
# general
a
Is it possible to
./pants export --symlink-python-virtualenv --resolve=python-default
to link against a certain python version. It is building using python3.9 and I would like to see the virtual-env in 3.10
h
IIRC it should use an interpreter compatible with the constraints applied when you generated the lockfile
Is your lockfile compatible with 3.9 and 3.10?
a
Copy code
[python]
enable_resolves = true
resolves_generate_lockfiles = false
# performance improvement since we are not using PEX-style lock files
# see <https://www.pantsbuild.org/docs/reference-python#run_against_entire_lockfile>
run_against_entire_lockfile = true

interpreter_constraints = [">=3.9,<3.11"]

[python.resolves]
python-default = "3rdparty/python/_requirements.txt"
pants-plugins = "build_support/plugins/deps_lock.txt"

[pip-tools.resolves_to_requirements]
python-default = "3rdparty/python/requirements.in"
pants-plugins = "build_support/plugins/requirements.in"
h
So yeah
Try temporarily hiding the 3.9 interpreter from Pants (remove it from the $PATH, basically)
a
Wouldn't pants fail because it can't find python version since it needs python 3.9 or lower to run?
h
Ah, if you're still using
./pants
and not the new
pants
launcher then yes, that might cause issues.
But just for testing things out you can modify
./pants
temporarily to force-point to the hidden 3.9 interpreter (I think there may be an env var for that, depending on your script)
But regardless, we strongly recommend switching to `pants`: https://www.pantsbuild.org/docs/installation