happy-family-315
10/10/2023, 9:57 AMFailed to resolve requirements from PEX environment @ /tmp/pantsbuild/named_caches/pex_root/unzipped_pexes/6b15572581a6e7fb7c6a3c1893a4b2cccdc89e28.
Needed cp38-cp38-linux_x86_64 compatible dependencies for:
1: greenlet!=0.4.17; python_version >= "3" and (platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32"))))))
Required by:
SQLAlchemy 1.4.37
But this pex had no ProjectName(raw='greenlet', normalized='greenlet') distributions.
I am using a docker_environment and the new layout="zip" feature:
docker_environment(
name="local_qgis",
image="opengisch/qgis@sha256:9c02323a70a3cddea4f73ff94ded5cdae7d6cc128d0a140aee8128383f0815b4",
)
I found this issue https://github.com/pantsbuild/pants/issues/18936 and one comment said this error will be fixed in 2.17.0.broad-processor-92400
10/10/2023, 10:47 AM[lambdex] layout = "zip"
applies to python_awslambda
targets, but you mention you're packaging docker images, so I'm slightly wary of things being mixed up.
Could you confirm you see this error when running pants package path/to:target
where that target in path/to/BUILD
is a docker_image
?
Could you you could share the specific BUILD target definitions?
Potentially some more logging context would be good too, e.g. there might be an [ERROR] ...
line that would be good to see.happy-family-315
10/10/2023, 11:30 AMhappy-family-315
10/10/2023, 11:31 AMProcessExecutionFailure: Process 'Build python_awslambda artifact for services/qgis_file:qgis-lambda' failed with exit code 1.
happy-family-315
10/10/2023, 12:01 PMpython_awslambda(
name="qgis-lambda",
runtime="python3.8",
handler="lambda_handler.py:handler",
dependencies=[":glt"]
)
python_requirement(
name="glt",
requirements=["greenlet==1.1.1"],
)
Before I had greenlet 3.0.0 installed which was not recognized. After including it explicitly as an dependency in python_awslambda target I got:
ProcessExecutionFailure: Process 'Build python_awslambda artifact for services/qgis_file:qgis-lambda' failed with exit code 1.
stdout:
stderr:
A distribution for greenlet could not be resolved for cp38-cp38-linux_x86_64.
Found 1 distribution for greenlet that do not apply:
1.) The wheel tags for greenlet 3.0.0 are cp38-cp38-manylinux_2_24_x86_64, cp38-cp38-manylinux_2_28_x86_64 which do not match the supported tags of cp38-cp38-linux_x86_64:
cp38-cp38-manylinux2014_x86_64
... 86 more ...
Then I just guessed another version like 1.1.1 and it worked.
The error only occurs in pants 2.17.0. Is there a better way to find out what version of greenlet is for cp38-cp38-linux_x86_64.? I just tried some but that's not a good workflow.happy-family-315
10/10/2023, 12:21 PMhappy-family-315
10/10/2023, 12:24 PM12:07:57.31 [ERROR] 1 Exception encountered:
Engine traceback:
in `publish` goal
ProcessExecutionFailure: Process 'Build python_awslambda artifact for services/qgis-error:qgis-error-lambda' failed with exit code 1.
stdout:
stderr:
A distribution for langchain could not be resolved for cp38-cp38-linux_x86_64.
Found 1 distribution for langchain that do not apply:
1.) The distribution has a python requirement of <4.0,>=3.8.1 which does not match the python version of 3.8 for cp38-cp38-linux_x86_64.
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
enough-analyst-54434
10/10/2023, 6:09 PMlangchain
requires Python>=3.8.1,<4
but you're using a platform that just says 3.8, which includes / implies 3.8.0. And 3.8.0 does not meet the criteria langchain has; so the failure makes complete sense. Your new direction of using complete_platforms
is a correct one. Presumably the AWS Lambda 3.8 runtime / image you'll generate the complete platform from uses a newer CPython than 3.8.1.happy-family-315
10/19/2023, 3:23 PM