<#18399 `python_google_cloud_function` target reqi...
# github-notifications
q
#18399 `python_google_cloud_function` target reqiures `CPython&lt;3.10,&gt;=3.7` interpreter to be run Issue created by andrii-porokhnavets Describe the bug The 2.15 pants version was released as a binary package (
cpython3.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:
Copy code
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:
Copy code
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/pants