careful-address-89803
02/16/2023, 3:06 AM# TODO: It is pretty ad-hoc that we do add the interpreter version for resolves but not for tools.
# We should pick one and deprecate the other.
Would anything bad happen if we were to not add the full version? I don't think it's possible for a resolve to have 2 interpreters associated with it?
removing the version from the path of the exported venv would help solve issues setting up dev environments, like this one, and also what I hit today where my system's version of python got bumped but the old venv stuck around.
For backwards compatibility, we could add it as a toggle. or go all the way with the linked issue and provide custom export paths optionally with the versionenough-analyst-54434
02/16/2023, 3:10 AMI don't think it's possible for a resolve to have 2 interpreters associated with it?It is. A resolve has an associated interpreter constraint and something like Pants own "CPython>=3.7,<3.10" Can work with any of 3 interpreters if you have 3.7, 3.8 and 3.9 installed on your machine.
careful-address-89803
02/16/2023, 3:21 AMenough-analyst-54434
02/16/2023, 3:38 AMenough-analyst-54434
02/16/2023, 3:39 AMPATH=just:this:time:$PATH ./pants export ...
- maybe new interpreter is picked.enough-analyst-54434
02/16/2023, 3:42 AMenough-analyst-54434
02/16/2023, 3:42 AMenough-analyst-54434
02/16/2023, 3:42 AMenough-analyst-54434
02/16/2023, 3:43 AMenough-analyst-54434
02/16/2023, 3:43 AMenough-analyst-54434
02/16/2023, 3:44 AMtox -epy27
... runs 27, tox -epy{27,3{5,6,7,8,9,10,11}}
- runs them all, etc.enough-analyst-54434
02/16/2023, 3:46 AM$ ls -1 .tox
dist
format-run
log
py27-integration
py310
py311
py311-integration
py311-pip22_3_1
py311-pip22_3_1-integration
py311-pip22_3-integration
py311-pip23_0
py311-pip23_0-integration
py36-integration
py37-integration
pypy39-integration
typecheck
Not sure if that helps guide thinking, but its one other tool's way of doing it.careful-address-89803
02/16/2023, 3:50 AMdist/export/python/virtualenvs/python-default
, and it is not universally safe to omit the version from the venv path.enough-analyst-54434
02/16/2023, 3:51 AMenough-analyst-54434
02/16/2023, 3:51 AMcareful-address-89803
02/16/2023, 3:56 AMproud-dentist-22844
02/16/2023, 4:05 AMproud-dentist-22844
02/16/2023, 4:06 AMproud-dentist-22844
02/16/2023, 5:11 AMexport
(or similar) have a simple way to say which interpreter to use (like virtualenv
or tox
)
Until then, I plan to force the selection of a particular interpreter using the PANTS_PYTHON_BOOTSTRAP_SEARCH_PATH
env var or the equivalent CLI option.
https://www.pantsbuild.org/docs/reference-python-bootstrap#search_pathproud-dentist-22844
02/16/2023, 5:32 AMexport
UI changes in 2.16 (cherry picked to 2.15) as well, but here's a link to that as well: https://github.com/pantsbuild/pants/pull/17416