plain-carpet-73994
09/20/2022, 12:07 AMpants repl
interacts with distribution targets. I have a sample library that depends on pyyaml
. That library has a target named lib
which is just a python_sources
goal and a target named example_lib
which is a python_distribution
target. If I do:
./pants repl src/example_lib/:lib
everything works fine. But suppose I want a repl with all the libs in my monorepo available. The obvious way to do that would be ./pants repl ::
but that gives me:
$ ./pants repl ::
Traceback (most recent call last):
File "/home/oliver/.pyenv/versions/3.10.0a7/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/oliver/.pyenv/versions/3.10.0a7/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/__main__.py", line 103, in <module>
bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/pex_bootstrapper.py", line 601, in bootstrap_pex
pex.PEX(entry_point).execute()
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/pex.py", line 519, in execute
self.activate()
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/pex.py", line 156, in activate
self._activated_dists = self._activate()
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/pex.py", line 143, in _activate
activated_dists.extend(env.activate())
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/environment.py", line 321, in activate
self._activated_dists = self._activate()
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/environment.py", line 671, in _activate
resolved = self.resolve()
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/environment.py", line 502, in resolve
for fingerprinted_distribution in self.resolve_dists(all_reqs)
File "/home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/aa78b3981cc88964a18a80d8fa2d708ffe5155b2/.bootstrap/pex/environment.py", line 589, in resolve_dists
raise ResolveError(
pex.environment.ResolveError: Failed to resolve requirements from PEX environment @ /home/oliver/.cache/pants/named_caches/pex_root/unzipped_pexes/452071acbd3c0c2b132caf245582cb4d49e6d821.
Needed cp310-cp310-manylinux_2_31_x86_64 compatible dependencies for:
1: pyyaml
Required by:
example-lib 1.0.0
But this pex had no ProjectName(raw='pyyaml', normalized='pyyaml') distributions.
2: types-PyYAML
Required by:
example-lib 1.0.0
But this pex had no ProjectName(raw='types-PyYAML', normalized='types-pyyaml') distributions.
Note that the actual built distribution has its dependencies specified correctly:
$ tar -O -zxvf dist/example_lib-1.0.0.tar.gz example_lib-1.0.0/setup.py
example_lib-1.0.0/setup.py
# DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
# Target: src/example_lib:example_lib
from setuptools import setup
setup(**{
'install_requires': (
'pyyaml',
'types-PyYAML',
),
'name': 'example_lib',
'namespace_packages': (
),
'package_data': {
},
'packages': (
'example_lib',
),
'python_requires': '==3.10.*',
'version': '1.0.0',
})
Is there no way to do a pants repl
for all libraries in a repo that has one or more distribution targets?happy-kitchen-89482
09/20/2022, 4:49 PMplain-carpet-73994
09/20/2022, 5:53 PMhappy-kitchen-89482
09/22/2022, 9:24 PMplain-carpet-73994
09/22/2022, 10:27 PMhappy-kitchen-89482
09/23/2022, 3:11 PMNeeded cp310-cp310-macosx_12_0_arm64 compatible dependencies
which is similar but not identicalhappy-kitchen-89482
09/23/2022, 3:11 PMhappy-kitchen-89482
09/23/2022, 3:11 PMhappy-kitchen-89482
09/23/2022, 3:12 PMplain-carpet-73994
09/23/2022, 3:41 PMplain-carpet-73994
09/23/2022, 6:49 PMhappy-kitchen-89482
09/23/2022, 8:11 PMhappy-kitchen-89482
09/23/2022, 8:11 PMplain-carpet-73994
09/26/2022, 4:35 PM