famous-kite-46295
07/06/2024, 1:16 AMpants.backend.python.providers.experimental.pyenv
and I am wondering what the recommended way for specifying the exact Python version to install.
It seems to take the interpreter_constraints
in pants.toml
into account, but only to pick e.g. 3.10
vs 3.11
, it always installs 3.10.10
even if I specify 3.10.14
. Also tried it with a .python-version
file, same effect.famous-kite-46295
07/06/2024, 1:29 AM# Caching the result is OK, since if the user really needs a different patch,
# they should list a more precise IC.
https://github.com/pantsbuild/pants/blob/211f7e4eb289b28b8c4a9018abf8d98a088dd120/src/python/pants/backend/python/providers/pyenv/rules.py#L24[…]C50
I found this in this in the code but in my experiments this doesn’t work, the patch version specified in the IC does not get respected.famous-kite-46295
07/06/2024, 1:36 AMpython_to_use = request.interpreter_constraints.minimum_python_version(
python_setup.interpreter_versions_universe
)
https://github.com/pantsbuild/pants/blob/211f7e4eb289b28b8c4a9018abf8d98a088dd120/src/python/pants/backend/python/providers/pyenv/rules.py#L23[…]4C6
Should we be using something different here?broad-processor-92400
07/06/2024, 4:24 AMfamous-kite-46295
07/07/2024, 10:47 PMfamous-kite-46295
07/07/2024, 10:49 PMpyenv latest --known
currently returns) has more to with the fact that the included version of pyenv
is old and doesn’t know the patch version I want. (Fixed that by configuring [pyenv-python-provider]
in pants.toml
to use a newer pyenv
.)broad-processor-92400
07/08/2024, 5:20 AMFixed that by configuringAh, good catch. If you'd like to contribute a separate fix, bumping the version in https://github.com/huonw/pants/blob/cfb3cafcac2386c909bc4a3fee3997e1bd8b03d7/src/python/pants/backend/python/providers/pyenv/rules.py#L63-L100 would be awesome!in[pyenv-python-provider]
to use a newerpants.toml
pyenv
famous-kite-46295
07/08/2024, 5:29 PM