cool-easter-32542
04/20/2023, 7:43 AMdocker_image target to test a CLI.
docker_image(
name="docker",
skip_push=True,
dependencies=[":bin"],
repository="e2e-tests-image",
instructions=[
"FROM python:3.9",
"COPY cli.tests/bin.pex /bin/cli"
]
)
Although I wanted to directly copy the python distribution into the image, I couldn't find a way to do so, so I am using a pex_binary that depends on the python_distribution.
pex_binary(
name="bin",
entry_point="cli.main",
dependencies=["cli/src:dist"]
)
When I run the generated pex file manually on my machine, it works fine.
When I try to run cli inside a container (docker run -it e2e-tests-image bash), I get the following error (no transitive dependencies found)
Failed to find compatible interpreter on path /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
Examined the following interpreters:
1.) /usr/local/bin/python3.9 CPython==3.9.16
2.) /usr/bin/python3.9 CPython==3.9.2
No interpreter compatible with the requested constraints was found:
Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/e1302300f7c34e2335e6337901d8efccd5b1a826.
Needed cp39-cp39-manylinux_2_31_aarch64 compatible dependencies for:
1: protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5
Required by:
googleapis-common-protos 1.59.0
grpc-google-iam-v1 0.12.6
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
2: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5
Required by:
google-api-core 2.11.0
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
3: charset-normalizer<4,>=2
Required by:
requests 2.28.2
But this pex had no ProjectName(raw='charset-normalizer', normalized='charset-normalizer') distributions.
4: grpcio<2.0dev,>=1.33.2; extra == "grpc"
Required by:
google-api-core 2.11.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
5: protobuf>=4.21.6
Required by:
grpcio-status 1.53.0
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
6: grpcio>=1.53.0
Required by:
grpcio-status 1.53.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
7: grpcio<2.0.0dev,>=1.44.0
Required by:
grpc-google-iam-v1 0.12.6
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
8: grpcio<2.0.0dev,>=1.44.0; extra == "grpc"
Required by:
googleapis-common-protos 1.59.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
9: protobuf<5.0.0dev,>=3.19.0
Required by:
proto-plus 1.22.2
google-cloud-secret-manager 2.12.4
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/e1302300f7c34e2335e6337901d8efccd5b1a826.
Needed cp39-cp39-manylinux_2_31_aarch64 compatible dependencies for:
1: protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5
Required by:
googleapis-common-protos 1.59.0
grpc-google-iam-v1 0.12.6
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
2: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5
Required by:
google-api-core 2.11.0
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
3: charset-normalizer<4,>=2
Required by:
requests 2.28.2
But this pex had no ProjectName(raw='charset-normalizer', normalized='charset-normalizer') distributions.
4: grpcio<2.0dev,>=1.33.2; extra == "grpc"
Required by:
google-api-core 2.11.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
5: protobuf>=4.21.6
Required by:
grpcio-status 1.53.0
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
6: grpcio>=1.53.0
Required by:
grpcio-status 1.53.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
7: grpcio<2.0.0dev,>=1.44.0
Required by:
grpc-google-iam-v1 0.12.6
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
8: grpcio<2.0.0dev,>=1.44.0; extra == "grpc"
Required by:
googleapis-common-protos 1.59.0
But this pex had no ProjectName(raw='grpcio', normalized='grpcio') distributions.
9: protobuf<5.0.0dev,>=3.19.0
Required by:
proto-plus 1.22.2
google-cloud-secret-manager 2.12.4
But this pex had no ProjectName(raw='protobuf', normalized='protobuf') distributions.
Pants version
2.15.0
OS
MacOS
Additional info
My python package is using click==8.1.3 and google-cloud-secret-manager==2.12.4 as depenedencies.
Thanks.
pantsbuild/pants