quaint-telephone-89068
03/03/2023, 1:40 PMcpython3.9.15 python inside). I updated interpreter_constraints = ["==3.10.*"] in my pants.toml file to upgrade my codebase to python3.10. So, everything works fine (lint, check, fix, test, export) except python_google_cloud_function target. pants package :: command fails with the following output:
Engine traceback:
in `package` goal
in Create Python Google Cloud Function - functions/python/source-python-pubsub:python_pubsub_gcf
in Find Python interpreter for constraints - CPython<3.10,>=3.7
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython<3.10,>=3.7' failed with exit code 102.
stdout:
stderr:
Could not find a compatible interpreter.
Examined the following interpreters:
1.) /opt/hostedtoolcache/Python/3.10.10/x64/bin/python3.10 CPython==3.10.10
2.) /usr/bin/python3.10 CPython==3.10.6
No interpreter compatible with the requested constraints was found:
Version matches CPython<3.10,>=3.7
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
Looks like python_google_cloud_function doesn't use a pre-installed python interpreter inside pants and expects CPython<3.10,>=3.7 to be available on the machine.
Please take a look at this issue. My python_google_cloud_function target is the following:
python_google_cloud_function(
name="python_pubsub_gcf",
runtime="python310",
handler="main.py:handler",
type="event",
)
Pants version
2.15
OS
Linux, Ubuntu 22.04, x86_64
pantsbuild/pantsuser
03/05/2023, 7:57 PM