clever-table-90691
07/06/2020, 2:14 PMpython_awslambda
target?
I’m using pants.backend.awslambda.python
backend package to create lambda function
and the lambda function has a dependency to a 3rd party pyyaml
I’m getting the following error when I run ./pants awslambda
on my target
stderr:
ERROR: Could not find a version that satisfies the requirement pyyaml==5.3.1
I’m only getting error for pyyaml
and all the other 3rd-party dependencies are finehundreds-father-404
07/06/2020, 2:19 PM./pants --version
). Are you using the new docs at https://pants.readme.io/docs/awslambda-python?
Also what did you set for runtime
for the target?clever-table-90691
07/06/2020, 2:21 PM1.28.0
and runtime 3.8
yes that’s the doc that i’m using toohundreds-father-404
07/06/2020, 2:22 PMclever-table-90691
07/06/2020, 2:23 PMhundreds-father-404
07/06/2020, 2:23 PMhundreds-father-404
07/06/2020, 2:24 PMPyYAML-5.3.1.tar.gz
(https://pants.readme.io/docs/python-platforms for some more context, although page isn’t fully complete)clever-table-90691
07/06/2020, 3:15 PMpantsbuild.pants.contrib.awslambda-python
(before we moved to using backend package)clever-table-90691
07/06/2020, 3:15 PMhundreds-father-404
07/06/2020, 3:17 PMplatform
to linux, no matter what. Whereas earlier we would silently do the wrong thingclever-table-90691
07/06/2020, 3:22 PMplatform
to linux is the correct thing to doclever-table-90691
07/07/2020, 1:24 PM./pants awslambda
would fail if the dependencies doesn’t have the right prebuild bdist available and it wouldn’t install the package using sdist (when running on linux)hundreds-father-404
07/07/2020, 3:04 PMclever-table-90691
07/07/2020, 3:43 PMstderr:
[2020-07-07T13:03:55.557Z] ERROR: Could not find a version that satisfies the requirement pyyaml==5.3.1 (from versions: none)
[2020-07-07T13:03:55.557Z] ERROR: No matching distribution found for pyyaml==5.3.1
hundreds-father-404
07/07/2020, 3:46 PMpip install pex (or pipx install pex)
pex --platform=manylinux2014_x86_64-cp38 pyyaml==5.3.1
clever-table-90691
07/07/2020, 5:24 PMpex --platform=manylinux2014_x86_64-cp-38-cp38 pyyaml==5.3.1
but it’s failing with the error
ERROR: Could not find a version that satisfies the requirement pyyaml==5.3.1 (from versions: none)
we think the issue might be with PEX
@many-agent-62725hundreds-father-404
07/07/2020, 5:26 PMmany-agent-62725
07/07/2020, 5:29 PMpex --platform=manylinux2010_x86_64-cp-38-cp38 pyyaml==5.3.1
will also give the following error: ERROR: Could not find a version that satisfies the requirement pyyaml==5.3.1 (from versions: none)
On the other hand, if we remove the platform string (pex pyyaml==5.3.1
), we enter the PEX REPL
Python 3.8.2 (default, Mar 11 2020, 00:29:50)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
many-agent-62725
07/07/2020, 5:31 PM--only-binary :all:
hundreds-father-404
07/07/2020, 5:35 PMenough-analyst-54434
07/07/2020, 7:22 PM"current"
) platform string is satisfiable by a local interpreter.enough-analyst-54434
07/07/2020, 7:24 PMpex --platform=manylinux2014_x86_64-cp-38-cp38 pyyaml==5.3.1
do you do so on a linux machine or on OSX?enough-analyst-54434
07/07/2020, 7:25 PM--python=python3.8
instead of specifying the platform. If on OSX, you'll need to make sure linux wheels for that platform are pre-built and available in the list of --index and --find-links you let Pex know about.hundreds-father-404
07/07/2020, 7:27 PM--platform
value. cc @happy-kitchen-89482enough-analyst-54434
07/07/2020, 7:50 PMenough-analyst-54434
07/07/2020, 7:50 PMhundreds-father-404
07/07/2020, 7:51 PMruntime
as one of those 4 values in their awslambda target. Then we set the platform accordinglyenough-analyst-54434
07/07/2020, 7:52 PMenough-analyst-54434
07/07/2020, 7:54 PMenough-analyst-54434
07/07/2020, 7:55 PMhundreds-father-404
07/07/2020, 7:56 PMu
logic. We originally always had m
, and a user contributed a patch to not use it with >=3.8 because it’s now cp38
, not cp38m
enough-analyst-54434
07/07/2020, 7:58 PMenough-analyst-54434
07/07/2020, 7:58 PMenough-analyst-54434
07/07/2020, 8:00 PMenough-analyst-54434
07/07/2020, 8:01 PMhundreds-father-404
07/07/2020, 8:02 PMenough-analyst-54434
07/07/2020, 8:17 PM--platform
and --python
(or --interpreter-constraint
) as things stand given remoting possibly being in play so noted the alternative requiring Pex features. We still may be able to do that purely on the Pants side but depends on details of the current state of MultiPlatformProcess
and the interaction of PlatformConstraints
with remote / local.many-agent-62725
07/07/2020, 11:36 PMplatforms=PexPlatforms([]),
in line 77 (https://github.com/pantsbuild/pants/blob/39ae9b9a8be2f14343dde4198043c339148d58f4/src/python/pants/backend/awslambda/python/awslambda_python_rules.py#L77) and let PEX decide?hundreds-father-404
07/07/2020, 11:39 PMmacos
wheel for something like PyYAML and Pants would say that everything worked. Then when you run it in AWS, it would fail.enough-analyst-54434
07/11/2020, 12:48 AMclever-table-90691
07/14/2020, 3:03 PM