<#22195 Support Python interpreter pre-releases> I...
# github-notifications
c
#22195 Support Python interpreter pre-releases Issue created by huonw Is your feature request related to a problem? Please describe. Python does pre-releases of new major versions. It'd be great for Pants to make it easy to use one of these, e.g. to flush out bugs and/or experiment with new features. Currently, setting interpreter constraints to include a pre-release doesn't seem to work. For instance: I have
3.11.0a3
installed via pyenv but using this configuration [GLOBAL] pants_version = "2.27.0.dev2" backend_packages = ["pants.backend.python"] [python] interpreter_constraints = ["CPython==3.11.0a3"] Fails like:
Copy code
11:11:43.99 [ERROR] 1 Exception encountered:

Engine traceback:
  in `run` goal

ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython==3.11.0a3' failed with exit code 1.
stdout:

stderr:
Could not find a compatible interpreter.

Examined the following working interpreters:
1.)                                                           /Users/huon/.pyenv/versions/2.7.18/bin/python2.7 CPython==2.7.18
2.)                                                          /Users/huon/.pyenv/versions/3.10.1/bin/python3.10 CPython==3.10.1
3.)                                                          /Users/huon/.pyenv/versions/3.10.4/bin/python3.10 CPython==3.10.4
4.)                                                          /Users/huon/.pyenv/versions/3.11.0/bin/python3.11 CPython==3.11.0
5.)                                                          /Users/huon/.pyenv/versions/3.11.1/bin/python3.11 CPython==3.11.1
6.)                                                          /Users/huon/.pyenv/versions/3.12.0/bin/python3.12 CPython==3.12.0
7.)                                                           /Users/huon/.pyenv/versions/3.7.13/bin/python3.7 CPython==3.7.13
8.)                                                            /Users/huon/.pyenv/versions/3.8.7/bin/python3.8 CPython==3.8.7
9.)                                                            /Users/huon/.pyenv/versions/3.9.1/bin/python3.9 CPython==3.9.1
10.)                                                           /Users/huon/.pyenv/versions/3.9.10/bin/python3.9 CPython==3.9.10
11.)                                                           /Users/huon/.pyenv/versions/3.9.17/bin/python3.9 CPython==3.9.17
12.)                                                            /Users/huon/.pyenv/versions/3.9.7/bin/python3.9 CPython==3.9.7
13.)                                       /Users/huon/.local/share/mise/installs/python/3.10.14/bin/python3.10 CPython==3.10.14
14.)       /Users/huon/.cache/pants/pants_dev_deps/fe2d7dc6846a5cbc52083d73263bec9cf29e69e3.venv/bin/python3.11 CPython==3.11.9
15.)         /opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/bin/python3.12 CPython==3.12.7
16.)              /opt/homebrew/Cellar/python@3.8/3.8.19/Frameworks/Python.framework/Versions/3.8/bin/python3.8 CPython==3.8.19
17.)              /opt/homebrew/Cellar/python@3.9/3.9.20/Frameworks/Python.framework/Versions/3.9/bin/python3.9 CPython==3.9.20
18.)         /opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/bin/python3.13 CPython==3.13.0
19.)          /opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/bin/python3.10 CPython==3.10.15
20.) /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6
Describe the solution you'd like 1. Setting interpreter constraints that refer to pre-release versions should work if such a version is installed on the system 2. Python provider backends (like
pants.backend.python.providers.experimental.pyenv
and
pants.backend.python.providers.experimental.python_build_standalone
) should support installing pre-releases if they are published (see #22192 for prior work here) Describe alternatives you've considered N/A Additional context Testing Python pre-releases seems awkward in general; can Pants make it easier? pantsbuild/pants