quiet-lunch-43165
02/28/2024, 3:02 AMSuccessfully built the wheel simplejson-3.17.2-cp39-cp39-linux_x86_64.whl from the sdist simplejson-3.17.2.tar.gz but it is not compatible with the requested foreign target complete platform cp311-cp311-manylinux_2_26_x86_64
better-van-82973
02/28/2024, 4:18 AMsdist
the package is built from a source distribution.
Is there a difference in Python version between your Github Actions pipeline and your local machine?quiet-lunch-43165
02/28/2024, 5:43 AMsteps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.11.5
- name: Initialize Pants
uses: pantsbuild/actions/init-pants@v5-scie-pants
- name: Build
id: build-image
run: |
pants package path/to/docker:image
quiet-lunch-43165
02/28/2024, 5:44 AM# Set default build values for the component.
__defaults__(
{
(
python_sources,
python_tests,
python_test_utils,
python_aws_lambda_function,
python_aws_lambda_layer,
pex_binary,
): {
"resolve": "my_resolve",
},
(python_sources, python_tests, python_test_utils, pex_binary): {
"interpreter_constraints": ["==3.11.*"],
},
(python_aws_lambda_function, python_aws_lambda_layer): {"runtime": "python3.11"},
}
)
quiet-lunch-43165
02/28/2024, 5:46 AMdocker_image(
name="image",
dependencies=["dep/path/main:my_func"],
)
quiet-lunch-43165
02/28/2024, 5:47 AM[python]
interpreter_constraints = ["CPython==3.11.*"]
enable_resolves = true
[python.resolves_to_interpreter_constraints]
my_resolve = ["CPython==3.11.*"]
quiet-lunch-43165
02/29/2024, 3:37 AMcomplete_platforms = "linux_x86_py311"
for pex_binary
targets, no luckbetter-van-82973
02/29/2024, 4:15 AMquiet-lunch-43165
02/29/2024, 4:20 AMquiet-lunch-43165
02/29/2024, 4:23 AMbetter-van-82973
02/29/2024, 4:26 AMdep/path/main:my_func
is a lambda functionquiet-lunch-43165
02/29/2024, 4:28 AMpython_aws_lambda_function(
name="my_func",
handler="run.py:lambda_handler",
)
better-van-82973
02/29/2024, 4:35 AMruntime
via the defaults - but what happens if you explicitly set the lambda function runtime to python3.11
?quiet-lunch-43165
02/29/2024, 4:58 AM__defaults__(
{
(
python_sources,
python_tests,
python_test_utils,
python_aws_lambda_function,
python_aws_lambda_layer,
pex_binary,
): {
"resolve": "my_resolve",
},
(python_sources, python_tests, python_test_utils, pex_binary): {
"interpreter_constraints": ["==3.11.*"],
},
(python_aws_lambda_function, python_aws_lambda_layer): {"runtime": "python3.11"},
}
)
quiet-lunch-43165
02/29/2024, 5:05 AMruntime
to python3.11
in python_aws_lambda_function
, no dice