alert-dawn-51425
04/14/2023, 6:17 PMSetupPyError: Expected a single interpreter constraint for python/org/domain/library:library, got: CPython==3.10.* OR CPython==3.10.*,==3.9.*.
I am not sure where the interpreter constraints are generated from.
For the python_distribution, we have
kwargs["interpreter_constraints"] = ["==3.10.*"]
defined in a macro.
However, in pants.toml we have it declared as
interpreter_constraints = ["==3.10.*", "==3.9.*"]
So that the plugin code can work. I thought that adding the interpreter constrain on all the pex_binary, python_sources, python_tests, python_test_utils and on the python_distribution would ensure that this would only use python 3.10.
Why is it still bringing in 3.9?enough-analyst-54434
04/14/2023, 6:34 PM[">=3.9,<3.11"]
instead of ["==3.9.**, "==3.10.**"]
- it means the same thing, but no non-standard OR.alert-dawn-51425
04/14/2023, 7:48 PMenough-analyst-54434
04/14/2023, 7:50 PMenough-analyst-54434
04/14/2023, 7:51 PMalert-dawn-51425
04/14/2023, 8:10 PMalert-dawn-51425
04/14/2023, 8:10 PMalert-dawn-51425
04/14/2023, 8:11 PMalert-dawn-51425
04/14/2023, 8:16 PM[">=3.9,<3.11"]
did fix the problem. Thank you.alert-dawn-51425
04/14/2023, 8:16 PMenough-analyst-54434
04/14/2023, 9:04 PM/this/exact/python my.pex
or, if you are installing the PEX in a docker image, doing said same at venv install time as per https://pex.readthedocs.io/en/v2.1.131/recipes.html#pex-app-in-a-container and https://blog.pantsbuild.org/optimizing-python-docker-deploys-using-pants/