early-umbrella-56089
08/24/2023, 9:33 AM[python]
interpreter_constraints = [">=3.11"]
(Also tried explicit CPython)
Part of the traceback I think it’s relevant:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
I’m mac. My 2 of my colleagues got the same issue (they’re on mac as well). Thanks for any help.billions-toddler-84781
08/24/2023, 10:05 AMinterpreter_constraints only implies that the constraints are checked if they are compatible with a specific interpreter version? I think it does not imply what interpreter your target runs on.early-umbrella-56089
08/24/2023, 10:22 AMrefined-addition-53644
08/24/2023, 10:44 AMrefined-addition-53644
08/24/2023, 10:55 AMearly-umbrella-56089
08/24/2023, 12:32 PM[python-bootstrap]
search_path = ["<PYENV>"]
and even adding path to the pyvenv bin folder for the given python version explicitly. Is there any trick how to make it work?early-umbrella-56089
08/24/2023, 1:12 PMls 3rdparty/python/wheels/
BUILD httptools-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl
httptools-0.6.0-cp311-cp311-linux_x86_64.whl httptools-0.6.0-cp311-py311-none-any.whl
I used exactly the linux target I needed, but based on @refined-addition-53644 link I used whitelabeled name.
[python-repos]
# None of these 3 approaches worked
# repos = [
# "%(buildroot)s/3rdparty/python/wheels"
# ]
# find_links="%(buildroot)s/3rdparty/python/wheels"
find_links="file:///Users/xxx/workspaces/the_project/3rdparty/python/wheels"
stderr:
No pre-built wheel was available for httptools 0.6.0.
Successfully built the wheel httptools-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl from the sdist httptools-0.6.0.tar.gz but it is not compatible with the requested foreign target abbreviated platform cp311-cp311m-linux_x86_64.
You'll need to build a wheel from httptools-0.6.0.tar.gz on the foreign target platform and make it available to Pex via a `--find-links` repo or a custom `--index`.refined-addition-53644
08/24/2023, 1:30 PMinterpreter_constraints = ["CPython==3.9.*"]
Also I think the syntax for 3.11 should be like. I think CPython is missing. Check the docs
interpreter_constraints = ["CPython>=3.11,<3.12"]
# equivalent
interpreter_constraints = ["CPython==3.11.*"]early-umbrella-56089
08/24/2023, 1:43 PMAs a shortcut, you can leave offand just put the version specifier. For example,CPythonwill be expanded automatically to==3.8.CPython==3.8
early-umbrella-56089
08/24/2023, 1:46 PMrefined-addition-53644
08/24/2023, 1:46 PMearly-umbrella-56089
08/24/2023, 1:47 PMrefined-addition-53644
08/24/2023, 1:47 PMearly-umbrella-56089
08/24/2023, 1:47 PMearly-umbrella-56089
08/25/2023, 6:13 AMbroad-processor-92400
08/25/2023, 6:20 AMwide-midnight-78598
08/25/2023, 6:22 AMbroad-processor-92400
08/25/2023, 6:22 AMwide-midnight-78598
08/25/2023, 6:24 AMscie-pants installed via brew or something? Or are you using the pants bash script?early-umbrella-56089
08/25/2023, 6:37 AM[GLOBAL]
pants_version = "2.16.0"
backend_packages.add = [
'pants.backend.python',
'pants.backend.python.lint.docformatter',
# "pants.backend.python.lint.autoflake",
"pants.backend.python.lint.pyupgrade",
'pants.backend.python.lint.black',
'pants.backend.python.lint.flake8',
'pants.backend.python.lint.isort',
'pants.backend.python.typecheck.mypy',
"pants.backend.python.lint.bandit",
"pants.backend.docker",
"pants.backend.shell",
"pants.backend.shell.lint.shfmt",
"pants.backend.shell.lint.shellcheck",
"pants.backend.experimental.helm"
]
[source]
root_patterns = [
"/lib/python",
"/services/python",
"/test/python",
]
[python]
interpreter_constraints = ["CPython>=3.11"]
enable_resolves = true
default_resolve = "python-default"
[python.resolves]
python-default = "3rdparty/python/lockfiles/default.lock"
mypy = "3rdparty/python/lockfiles/mypy.lock"
[python-repos]
find_links="%(buildroot)s/3rdparty/python/wheels"
# [python.resolves_to_no_binary]
# python-default= ["httptools"]
[python-bootstrap]
# I tried only pyenv and also specifying only explicit path to the 3.11. In other words I excluded the system Python from this search path
search_path = ["<PYENV>", "<PATH>"]
[anonymous-telemetry]
enabled = false
[python-infer]
string_imports = true
[generate-lockfiles]
diff = true
[pytest]
execution_slot_var = "PANTS_EXECUTION_SLOT"
config = "tools/pytest.ini"
[mypy]
install_from_resolve = "mypy"
config = "tools/mypy.ini"
[flake8]
config = "tools/.flake8"
[bandit]
config = "tools/bandit.yaml"
[black]
config = "tools/pyproject.toml"
[isort]
config = "tools/pyproject.toml"
[docker]
env_vars = [
"DOCKER_BUILDKIT=0",
"COMPOSE_DOCKER_CLI_BUILD=0"
]
Running this command
pants --print-stacktrace run services/python/my_service:run
The target BUILD (my intention is to build it for current for local dev and linux for docker image)
...
pex_binary(
name="run",
entry_point="run_uvicorn.py",
dependencies=[":lib"],
platforms=[
"current",
# "macosx-10.13-x86_64-cp-311-cp311m"
# "linux-x86_64-cp-311-cp311m",
],
)early-umbrella-56089
08/25/2023, 6:38 AMearly-umbrella-56089
08/25/2023, 6:41 AM/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9 is the version mac is using. I made sure there is not other 3.9 Python version on my system. The default python and python3 is pointing to 3.11.wide-midnight-78598
08/25/2023, 6:41 AMscie-pants via brew is fine - it’s what I would have recommended. Just checking, as that one comes with python3.9 for Pants to run - so that should be all goodbroad-processor-92400
08/25/2023, 6:42 AMplatforms=["current"] is suspicous. What happens if you don't provide it at all?early-umbrella-56089
08/25/2023, 6:51 AMplatforms helped to build it at my platform! 🎉 I took from some example in docs, but maybe it’s deprecated.
Anyway, I still needs to be able to build it for linux for docker image (using python:3.11 base image). When I put only linux to the platforms I get this wheel error:
08:46:33.03 [ERROR] 1 Exception encountered:
Engine traceback:
in select
..
in pants.core.goals.run.run
`run` goal
Traceback (most recent call last):
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
res = rule.send(arg) if err is None else rule.throw(throw or err)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/core/goals/run.py", line 292, in run
request = await (
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 118, in __await__
result = yield self
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
res = rule.send(arg) if err is None else rule.throw(throw or err)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/backend/python/goals/run_pex_binary.py", line 22, in create_pex_binary_run_request
built_pex = await Get(BuiltPackage, PexFromTargetsRequestForBuiltPackage, pex_request)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 118, in __await__
result = yield self
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
res = rule.send(arg) if err is None else rule.throw(throw or err)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/backend/python/goals/package_pex_binary.py", line 202, in built_pacakge_for_pex_from_targets_request
pex = await Get(Pex, PexFromTargetsRequest, pft_request)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 118, in __await__
result = yield self
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
res = rule.send(arg) if err is None else rule.throw(throw or err)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/backend/python/util_rules/pex.py", line 800, in create_pex
result = await Get(BuildPexResult, PexRequest, request)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 118, in __await__
result = yield self
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
res = rule.send(arg) if err is None else rule.throw(throw or err)
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/backend/python/util_rules/pex.py", line 720, in build_pex
result = await Get(
File "/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 118, in __await__
result = yield self
pants.engine.process.ProcessExecutionFailure: Process 'Building 21 requirements for services.python.axa_service/run.pex from the 3rdparty/python/lockfiles/default.lock resolve: UnleashClient>=5.8.0, aiohttp>=3.8.4, ariadne-django>=0.3.0, ariadne>=0.20.1, cachetools>=5.3.1, django-enum-choices>=2.1.4, django-phonenumber-field[phonenumberslite]>=7.1.0, django>=4, djangorestframework>=3.14.0, orjson>=3.9.5, phonenumbers>=8.13.19, pydantic==1.10.12, python-keycloak>=3.3.0, returns>=0.19.0, sentry-sdk>=1.28.1, slack-sdk>=3.21.3, structlog>=23.1.0, tomli>=2.0.1, twilio>=8.7.0, uvicorn[standard]>=0.23.0, yarl>=1.9.2' failed with exit code 1.
stdout:
stderr:
No pre-built wheel was available for httptools 0.6.0.
Successfully built the wheel httptools-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl from the sdist httptools-0.6.0.tar.gz but it is not compatible with the requested foreign target abbreviated platform cp311-cp311m-linux_x86_64.
You'll need to build a wheel from httptools-0.6.0.tar.gz on the foreign target platform and make it available to Pex via a `--find-links` repo or a custom `--index`.
I already built the linux wheel as mentioned in - https://pantsbuild.slack.com/archives/C046T6T9U/p1692882725766139?thread_ts=1692869602.927969&cid=C046T6T9Uwide-midnight-78598
08/25/2023, 6:56 AMpex_binary(
name="helloworld-pex",
entry_point="helloworld.main",
dependencies=[
":libhelloworld",
],
platforms=["linux-x86_64-cp-311-cp311", "macosx-13.3-arm64-cp-311-cp311",]
)wide-midnight-78598
08/25/2023, 6:57 AMscie
Though, I did just recall this isn’t in Pants directly, it’s a plugin I wrote.
scie_binary(
name="helloworld",
dependencies=[":helloworld-pex"],
platforms=["linux-x86_64", "macos-aarch64"]
)broad-processor-92400
08/25/2023, 7:03 AMcurrent indeed is a bit confused, as maybe it'll be referring to the Pants-internal Python 3.9 interpreter, rather than the correct Python 3.11 one. Sorry about that. Do you have a moment to file an issue about it?
For the find links, I'm not sure if the relevant find-links things will be included by default in the sandbox that pants creates. Can you use https://www.pantsbuild.org/docs/troubleshooting#debug-tip-inspect-the-sandbox-with---keep-sandboxes to look at the sandbox, e.g. pants --keep-sandboxes=on_failure ... , find the relveant directory and then look at the contents (including __run.sh in it)?early-umbrella-56089
08/25/2023, 7:10 AM> cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export PATH=$'/usr/bin:/bin:/usr/local/bin'
cd /private/var/folders/kp/50bqlmp100q03gpnrxdfwdwc0000gn/T/pants-sandbox-QOooEu
./find_binary.sh bash
> cat find_binary.sh
#!/usr/bin/env bash
set -euox pipefail
CHECK_FILE_ENTRIES=
for path in ${PATH//:/ }; do
if [[ -d "${path}" ]]; then
# Handle traditional directory PATH element.
maybe_exe="${path}/$1"
elif [[ -n "${CHECK_FILE_ENTRIES}" ]]; then
# Handle PATH elements that are filenames to allow for precise selection.
maybe_exe="${path}"
else
maybe_exe=
fi
if [[ "$1" == "${maybe_exe##*/}" && -f "${maybe_exe}" && -x "${maybe_exe}" ]]
then
echo "${maybe_exe}"
fi
done
> ls
__run.sh find_binary.shbroad-processor-92400
08/25/2023, 7:11 AM--keep-sandboxes=always or --keep-sandboxes=on_failure? The first one may output a lot of different directories for all the different bits of set-up pants does, while the second one will (hopefully) output just one, for the failing PEX build command...early-umbrella-56089
08/25/2023, 7:15 AM> ls 3rdparty/python/
lockfiles
Run file:
> cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export CPPFLAGS= LC_CTYPE=UTF-8 LDFLAGS=$'-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib' PATH=$'/Users/martinvo/.pyenv/shims:/Users/martinvo/Downloads/google-cloud-sdk/bin:/usr/local/opt/sphinx-doc/bin:/Users/martinvo/.local/bin:/Users/martinvo/.poetry/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/martinvo/.cargo/bin' PEX_IGNORE_RCFILES=true PEX_PYTHON=/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/bin/python PEX_ROOT=.cache/pex_root
cd /private/var/folders/kp/50bqlmp100q03gpnrxdfwdwc0000gn/T/pants-sandbox-d6uRIR
/Users/martinvo/Library/Caches/nce/2e4f5456e74f7e8b3489c9ced8c844ba1113bfbf37dcaf688859cb976f884ea0/bindings/venvs/2.16.0/bin/python ./pex --tmpdir .tmp --jobs 8 --pip-version 20.3.4-patched --python-path $'/Users/martinvo/.pyenv/versions/3.11.4/bin:/Users/martinvo/.pyenv/shims:/Users/martinvo/Downloads/google-cloud-sdk/bin:/usr/local/opt/sphinx-doc/bin:/Users/martinvo/.local/bin:/Users/martinvo/.poetry/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/martinvo/.cargo/bin:/usr/local/bin' --output-file services.python.axa_service/run.pex --no-emit-warnings --requirements-pex local_dists.pex --platform linux-x86_64-cp-311-cp311m --entry-point axa_service.run_uvicorn $'--sources-directory=source_files' $'UnleashClient>=5.8.0' $'aiohttp>=3.8.4' $'ariadne-django>=0.3.0' $'ariadne>=0.20.1' $'cachetools>=5.3.1' $'django-enum-choices>=2.1.4' $'django-phonenumber-field[phonenumberslite]>=7.1.0' $'django>=4' $'djangorestframework>=3.14.0' $'orjson>=3.9.5' $'phonenumbers>=8.13.19' $'pydantic==1.10.12' $'python-keycloak>=3.3.0' $'returns>=0.19.0' $'sentry-sdk>=1.28.1' $'slack-sdk>=3.21.3' $'structlog>=23.1.0' $'tomli>=2.0.1' $'twilio>=8.7.0' $'uvicorn[standard]>=0.23.0' $'yarl>=1.9.2' --lock 3rdparty/python/lockfiles/default.lock --no-pypi $'--index=<https://pypi.org/simple/>' $'--find-links=/Users/martinvo/workspaces/sure_source/3rdparty/python/wheels' --manylinux manylinux2014 --layout zipappearly-umbrella-56089
08/25/2023, 7:19 AMfile:///Users/martinvo/workspaces/sure_source/3rdparty/python/wheels value for find links and it seems to get propagated to the wheel command, but failing with the same resultbroad-processor-92400
08/25/2023, 7:20 AM--find-links.
The next step here would be reproducing the problem by running __run.sh and then, if it does, edit it down to the minimum (e.g. progressively delete the various arguments after .../python ./pexbroad-processor-92400
08/25/2023, 7:21 AM--pip-version 20.3.4-patched to --pip-version latest?early-umbrella-56089
08/25/2023, 7:31 AM__run.sh is executed. I’ll try to play with this script as suggested, this should be more pleasant debugging then changing pants.toml. Thanks for getting me here.
I’m thinking can be the wheel names somehow invalid so they’re not picked up? I don’t have much experience with building wheels, so I wonder I didn’t mess up something. I hoped one of these two will be matched:
httptools-0.6.0-cp311-cp311-linux_x86_64.whl httptools-0.6.0-cp311-py311-none-any.whlbroad-processor-92400
08/25/2023, 7:43 AMbroad-processor-92400
08/25/2023, 7:53 AM-v several times or setting PEX_VERBOSE=1 (or higher) for increased verbosity (I think) or an arg something like —preserve-pip-download-log (you’ll need to check —help to confirm), which may help with debuggingbroad-processor-92400
08/25/2023, 8:53 AMhttptools, so I'm a bit surprised you're needing to build your own. I don't have specific advise or understand the mechanism, just that there's potentially something unexpected going on 🤔early-umbrella-56089
08/25/2023, 8:55 AMpex -v httptools==0.6.0 --platform linux-x86_64-cp-311-cp311m
(note pex is alias for the python pex from the __setup.py)
Resulting in the same error as above.
This one works:
pex -v httptools==0.6.0
But this one don’t:
pex -v --no-index httptools==0.6.0 --find-links=/Users/martinvo/workspaces/sure_source/3rdparty/python/wheels
So it seems that the platform might be the issue. The thing is that I’m building linux on mac, so I can’t use default 🤔broad-processor-92400
08/25/2023, 8:58 AMplatform to complete_platform might be appropriate, to give pex more specifics about what platform it needs to choose wheels for
https://github.com/pantsbuild/pants/discussions/18756 walks through how we do it (after talking about lambdas)enough-analyst-54434
08/25/2023, 11:38 AMm in your platform strings. Python discontinued support for that in 3.8.enough-analyst-54434
08/25/2023, 11:42 AMearly-umbrella-56089
08/25/2023, 12:17 PMm from platform it seems I was able to create the pex file. However when running it throws an error. It seems that like some mismatch with python version again 🤔
> python ./pex -v httptools==0.6.0 --platform linux-x86_64-cp-311-cp311
pex: Building pex :: Resolving distributions (httptools==0.6.0) :: Resolving requirements. :: Resolving for:
pex: Hashing pex: 237.1ms
pex: Isolating pex: 0.0ms
pex: Calculating compatible python versions for ['==3.11.*']: 8.9ms
pex: Building pex :: Resolving distributions (httptools==0.6.0) :: Resolving requirements. :: Calculating project names for direct requirements:
pex: Building pex :: Resolving distributions (httptools==0.6.0) :: Resolving requirements. :: Installing 1 distributions pex: Building pex: 1341.6ms
pex: Resolving distributions (httptools==0.6.0): 1341.0ms
pex: Resolving requirements.: 1340.7ms
pex: Resolving for:
cp311-cp311-linux_x86_64: 1315.6ms
pex: Calculating project names for direct requirements:
PyPIRequirement(line=LogicalLine(raw_text='httptools==0.6.0', processed_text='httptools==0.6.0', source='<string>', start_line=1, end_line=1), requirement=Requirement(name='httptools', url=None, extras=frozenset(), specifier=<SpecifierSet('==0.6.0')>, marker=None), editable=False): 0.1ms
pex: Installing 1 distributions: 16.0ms
pex: Checking install: 0.2ms
WARNING: attempting to run PEX with incompatible platforms!
Running on platform macosx_13_0_x86_64-cp-3.11.4-cp311 but built for linux_x86_64-cp-311-cp311
Running PEX file at /private/var/folders/kp/50bqlmp100q03gpnrxdfwdwc0000gn/T/tmpxowh93it with args []
pex: Correcting mis-configured MACOSX_DEPLOYMENT_TARGET of 13 to 13.0 corresponding to a valid PEP-425 platform of macosx-13.0-x86_64 for PythonInterpreter('/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11', PythonIdentity('/usr/local/opt/python@3.11/bin/python3.11', 'cp311', 'cp311', 'macosx_13_0_x86_64', (3, 11, 4))).
pex: PEX.run invoking /usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -s -E /private/var/folders/kp/50bqlmp100q03gpnrxdfwdwc0000gn/T/tmpxowh93it
pex: Correcting mis-configured MACOSX_DEPLOYMENT_TARGET of 13 to 13.0 corresponding to a valid PEP-425 platform of macosx-13.0-x86_64 for PythonInterpreter('/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11', PythonIdentity('/usr/local/opt/python@3.11/bin/python3.11', 'cp311', 'cp311', 'macosx_13_0_x86_64', (3, 11, 4))).
Failed to find compatible interpreter on path /Users/martinvo/Downloads/google-cloud-sdk/bin:/usr/local/opt/sphinx-doc/bin:/Users/martinvo/.local/bin:/Users/martinvo/.poetry/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/martinvo/.cargo/bin:/usr/local/bin.
Examined the following interpreters:
1.) /usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 CPython==3.11.4
2.) /usr/local/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10 CPython==3.10.12
3.) /usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/bin/python3.7 CPython==3.7.16
4.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6
No interpreter compatible with the requested constraints was found:
A distribution for httptools could not be resolved for /usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11.
Found 1 distribution for httptools that do not apply:
1.) The wheel tags for httptools 0.6.0 are cp311-cp311-manylinux1_x86_64, cp311-cp311-manylinux_2_17_x86_64, cp311-cp311-manylinux_2_5_x86_64, cp311-cp311-manylinux2014_x86_64 which do not match the supported tags of /usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11:
cp311-cp311-macosx_13_0_x86_64
... 2412 more ...
A distribution for httptools could not be resolved for /usr/local/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10.
Found 1 distribution for httptools that do not apply:
1.) The wheel tags for httptools 0.6.0 are cp311-cp311-manylinux1_x86_64, cp311-cp311-manylinux_2_17_x86_64, cp311-cp311-manylinux_2_5_x86_64, cp311-cp311-manylinux2014_x86_64 which do not match the supported tags of /usr/local/Cellar/python@3.10/3.10.12_1/Frameworks/Python.framework/Versions/3.10/bin/python3.10:
cp310-cp310-macosx_13_0_x86_64
... 2219 more ...
A distribution for httptools could not be resolved for /usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/bin/python3.7.
Found 1 distribution for httptools that do not apply:
1.) The wheel tags for httptools 0.6.0 are cp311-cp311-manylinux1_x86_64, cp311-cp311-manylinux_2_17_x86_64, cp311-cp311-manylinux_2_5_x86_64, cp311-cp311-manylinux2014_x86_64 which do not match the supported tags of /usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/bin/python3.7:
cp37-cp37m-macosx_13_0_x86_64
... 1640 more ...
A distribution for httptools could not be resolved for /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9.
Found 1 distribution for httptools that do not apply:
1.) The wheel tags for httptools 0.6.0 are cp311-cp311-manylinux1_x86_64, cp311-cp311-manylinux_2_17_x86_64, cp311-cp311-manylinux_2_5_x86_64, cp311-cp311-manylinux2014_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9:
cp39-cp39-macosx_13_0_x86_64
... 2026 more ...enough-analyst-54434
08/25/2023, 2:34 PMenough-analyst-54434
08/25/2023, 3:55 PM-o some.pex argument, then a PEX file will be successfully built. Without the -o an ephemeral PEX is built (which works) and immediately run (which fails).happy-kitchen-89482
08/25/2023, 9:22 PMinterpreter_constraints = ["CPython==3.11.*"]
or similar.early-umbrella-56089
08/26/2023, 5:20 AMpex_binary(
name="run",
entry_point="run_uvicorn.py",
dependencies=[":lib"],
platforms=["linux-x86_64-cp-311-cp311", "macosx-13.3-arm64-cp-311-cp311"],
)
which is then used by docker_image target. Anyway, I’m now able to build it for my platform to run the pex locally or build it for linux so it can run in the docker target. My naive expectation was that specifying platform of my docker image + using “current” (which we found out is not current platform of machine, but platform used by pants) I can achieve that we can use one target for local runs (like testing, running the app locally) and when exporting we can use it as dependency of the docker target. Is something like this possible? Or is there any better way how to approach this?