quaint-telephone-89068
12/28/2022, 4:02 PMinterpreter_constraints. For example:
• pants.toml interpreter_constraints = [">= 3.8"]
• project_1 (no constraints, uses default)
• project_2 (specific requirements.txt + interpreter_constraints = [">= 3.10"])
In this scenario, when running ./pants export :: I get two virtualenvs, one for each project, but both use the same Python version 3.8.*.
I realise my explanation might be confusing, so I created an example small repository here. In this repo I expected py310 virtualenv to use Python 3.10.* (I do have it installed with pyenv), but as you can see bellow both use 3.8.*.
$ python/pants_export % ./pants export ::
11:30:16.82 [INFO] Completed: Building 1 requirement for requirements.pex from the 3rdparty/python/py310.lock resolve: boto3
Wrote virtualenv for the resolve 'py310' (using Python 3.8.13) to dist/export/python/virtualenvs/py310
Wrote virtualenv for the resolve 'py38' (using Python 3.8.13) to dist/export/python/virtualenvs/py38
Wrote virtualenv for the tool 'pytest' to dist/export/python/virtualenvs/tools
When running the code the projects do use the correct Python versions though.
$ python/pants_export % ./pants run src/with_py38:bin master
Running with 3.8.13 (default, Jul 26 2022, 09:50:21)
[Clang 13.1.6 (clang-1316.0.21.2.5)]
$ python/pants_export % ./pants run src/with_py310:bin master
Running with 3.10.5 (main, Jul 13 2022, 10:34:57) [Clang 13.1.6 (clang-1316.0.21.2.5)]
Pants version
2.12.0
OS
MacOS 12.4
pantsbuild/pantsuser
12/28/2022, 4:02 PM