echoing-farmer-15630
04/12/2021, 4:53 PMimportlib-metadata==3.10.0
and typing-extensions==3.7.4.3
to the requirements.txt
file and manually add dependencies=["//:importlib-metadata", "//:typing-extensions"]
to the python_awslambda
target. That works, and it executes... but was that correct and/or is there a better way to resolve that?hundreds-father-404
04/12/2021, 5:03 PMhappy-kitchen-89482
04/12/2021, 5:10 PMimportlib_metadata
, but importlib-metadata
is in the constraints.txt
in that example repo, so something transitively needs it.happy-kitchen-89482
04/12/2021, 5:10 PMhappy-kitchen-89482
04/12/2021, 5:11 PMtyping-extensions
happy-kitchen-89482
04/12/2021, 5:11 PMechoing-farmer-15630
04/12/2021, 5:15 PMinterpreter_constraints
line in pants.toml
(it was failing trying to get pyyaml on that version and disabling constraints but using requirements.txt
allowed it to build; I probably should have tried updating the constraints but another time)
In other words, with those two in requirements.txt and with dependencies=["//:importlib-metadata", "//:typing-extensions"],
in the BUILD for lambda, I get
...
//:importlib-metadata
...
//:typing-extensions
...but if I take out the dependencies=
line, those two are indeed missing.
Let me take it out, redeploy, and look at the error tracesechoing-farmer-15630
04/12/2021, 5:17 PMSTART RequestId: e4b8b696-0207-4950-93ab-5779fc87d236 Version: $LATEST
[ERROR] ResolveError: Failed to resolve requirements from PEX environment @ /var/task.
Needed manylinux_2_17_x86_64-cp-37-cp37m compatible dependencies for:
1: importlib-metadata>=0.12; python_version < "3.8"
Required by:
virtualenv 20.4.3
pluggy 0.13.1
tox 3.23.0
But this pex had no 'importlib-metadata' distributions.
2: importlib-metadata; python_version < "3.8"
Required by:
pre-commit 2.12.0
But this pex had no 'importlib-metadata' distributions.
Traceback (most recent call last):
File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/lambdex_handler.py", line 30, in <module>
bootstrap_pex_env(__entry_point__)
File "/var/task/.bootstrap/pex/pex_bootstrapper.py", line 495, in bootstrap_pex_env
PEXEnvironment(entry_point, pex_info).activate()
File "/var/task/.bootstrap/pex/environment.py", line 366, in activate
self._activated_dists = self._activate()
File "/var/task/.bootstrap/pex/environment.py", line 696, in _activate
resolved = self.resolve()
File "/var/task/.bootstrap/pex/environment.py", line 522, in resolve
self._resolved_dists = self.resolve_dists(all_reqs)
File "/var/task/.bootstrap/pex/environment.py", line 607, in resolve_dists
"{items}".format(pex=self._pex, platform=self._platform, items="\n".join(items))
END RequestId: e4b8b696-0207-4950-93ab-5779fc87d236
REPORT RequestId: e4b8b696-0207-4950-93ab-5779fc87d236 Duration: 9036.00 ms Billed Duration: 9036 ms Memory Size: 128 MB Max Memory Used: 33 MB
Unknown application error occurred
echoing-farmer-15630
04/12/2021, 5:18 PMSTART RequestId: dfda5498-7991-4232-8099-45c601d9b712 Version: $LATEST
[ERROR] ResolveError: Failed to resolve requirements from PEX environment @ /var/task.
Needed manylinux_2_17_x86_64-cp-37-cp37m compatible dependencies for:
1: typing-extensions>=3.6.4; python_version < "3.8"
Required by:
importlib-metadata 3.10.0
But this pex had no 'typing-extensions' distributions.
Traceback (most recent call last):
File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/lambdex_handler.py", line 30, in <module>
bootstrap_pex_env(__entry_point__)
File "/var/task/.bootstrap/pex/pex_bootstrapper.py", line 495, in bootstrap_pex_env
PEXEnvironment(entry_point, pex_info).activate()
File "/var/task/.bootstrap/pex/environment.py", line 366, in activate
self._activated_dists = self._activate()
File "/var/task/.bootstrap/pex/environment.py", line 696, in _activate
resolved = self.resolve()
File "/var/task/.bootstrap/pex/environment.py", line 522, in resolve
self._resolved_dists = self.resolve_dists(all_reqs)
File "/var/task/.bootstrap/pex/environment.py", line 607, in resolve_dists
"{items}".format(pex=self._pex, platform=self._platform, items="\n".join(items))
END RequestId: dfda5498-7991-4232-8099-45c601d9b712
REPORT RequestId: dfda5498-7991-4232-8099-45c601d9b712 Duration: 9917.03 ms Billed Duration: 9918 ms Memory Size: 128 MB Max Memory Used: 34 MB
Unknown application error occurred
echoing-farmer-15630
04/12/2021, 5:19 PMhappy-kitchen-89482
04/12/2021, 5:40 PMhappy-kitchen-89482
04/12/2021, 5:41 PMechoing-farmer-15630
04/12/2021, 6:10 PMpants.toml
file to remove the constraints when the resolution of pyyaml failed. So if I enable the constraints.txt again and take out my modifications to requirements.txt and BUILD (so I think this is where I started), ./pants package helloworld:awslambda
got me
...
stderr:
ERROR: Could not find a version that satisfies the requirement pyyaml>=5.1 (from pre-commit)
ERROR: No matching distribution found for pyyaml>=5.1
...
...which surprised me as well. So I'm not sure if constraints.txt is broken or... well, not sure really. But my woes started with the pyyaml error above which is why I disabled constraints, which then ended with the importlib-metadata and typing-extensions issues.happy-kitchen-89482
04/12/2021, 9:56 PMNo matching distribution found for pyyaml>=5.1
is pretty surprising, given https://pypi.org/project/PyYAML/happy-kitchen-89482
04/12/2021, 9:57 PMenough-analyst-54434
04/12/2021, 11:53 PMenough-analyst-54434
04/12/2021, 11:55 PMhappy-kitchen-89482
04/13/2021, 12:59 AMhappy-kitchen-89482
04/13/2021, 12:59 AMhappy-kitchen-89482
04/13/2021, 1:26 AMpex --output-file=foo.pex protobuf>=3.11.3 setuptools>=42.0.0 translate>=3.2.1
it works, and I get pyyaml in .deps/PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl/
happy-kitchen-89482
04/13/2021, 1:27 AM__run.sh
in the Pants process execution sandbox it fails with
ERROR: Could not find a version that satisfies the requirement pyyaml>=5.1 (from pre-commit)
ERROR: No matching distribution found for pyyaml>=5.1
happy-kitchen-89482
04/13/2021, 1:27 AMhappy-kitchen-89482
04/13/2021, 1:27 AMSkipping link: none of the wheel's tags match: cp36-cp36m-macosx_10_9_x86_64: <https://files.pythonhosted.org/packages/ef/e9/d62912119552b157ed66dc8297ae6ac08629d7d5c497d4faa26b0c3a4efe/PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl#sha256=6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253> (from <https://pypi.org/simple/pyyaml/>) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*)
happy-kitchen-89482
04/13/2021, 1:29 AMhappy-kitchen-89482
04/13/2021, 1:29 AMhappy-kitchen-89482
04/13/2021, 1:33 AMhappy-kitchen-89482
04/13/2021, 1:35 AM--platform
in my local runshappy-kitchen-89482
04/13/2021, 1:35 AM.deps/PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl/
happy-kitchen-89482
04/13/2021, 1:35 AMhappy-kitchen-89482
04/13/2021, 1:41 AM__run.sh
run it does find the prebuilt with matching tags:
Found link <https://files.pythonhosted.org/packages/7a/a5/393c087efdc78091afa2af9f1378762f9821c9c1d7a22c5753fb5ac5f97a/PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl#sha256=e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63> (from <https://pypi.org/simple/pyyaml/>) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*), version: 5.4.1
happy-kitchen-89482
04/13/2021, 1:57 AMconstraints.txt
filehappy-kitchen-89482
04/13/2021, 1:57 AMenough-analyst-54434
04/13/2021, 2:16 AMenough-analyst-54434
04/13/2021, 2:17 AMhappy-kitchen-89482
04/13/2021, 2:33 AMhappy-kitchen-89482
04/13/2021, 2:34 AMextra_requirements
of lambdexhappy-kitchen-89482
04/13/2021, 2:34 AMhappy-kitchen-89482
04/13/2021, 2:35 AMhappy-kitchen-89482
04/13/2021, 2:36 AMhappy-kitchen-89482
04/13/2021, 2:52 AMhappy-kitchen-89482
04/13/2021, 2:55 AMechoing-farmer-15630
04/13/2021, 2:43 PMhappy-kitchen-89482
04/17/2021, 6:03 AMhappy-kitchen-89482
04/18/2021, 5:44 AMhappy-kitchen-89482
04/18/2021, 5:44 AMhappy-kitchen-89482
04/18/2021, 5:45 AMhappy-kitchen-89482
04/18/2021, 5:46 AMhappy-kitchen-89482
04/18/2021, 5:46 AMhappy-kitchen-89482
04/18/2021, 5:49 AM