calm-librarian-70577
07/06/2024, 8:56 PMpytest-emulators-ewx
in a private Google Artifact Registry repo and I need Pants to use it as a requirement. I authenticate with keyrings.google-artifactregistry-auth
and this works fine in Poetry (and pip
). However, when I run pants test ::
I run into this error (anonymized):
22:27:32.95 [INFO] Completed: Building requirements.pex with 12 requirements: dependency-injector-fork<5.0.0,>=4.42.1, google-cloud-pubsub<3.0.0,>=2.21.5, google-cloud-storage<3.0.0,>=2.17.0, pulsar-client<4.0.0,>=3.5.0, pydantic<... (217 characters truncated)
22:27:32.96 [ERROR] 1 Exception encountered:
Engine traceback:
in `test` goal
ProcessExecutionFailure: Process 'Building requirements.pex with 12 requirements: dependency-injector-fork<5.0.0,>=4.42.1, google-cloud-pubsub<3.0.0,>=2.21.5, google-cloud-storage<3.0.0,>=2.17.0, pulsar-client<4.0.0,>=3.5.0, pydantic<2.0.0,>=1.10.10, pytest-emulators-ewx<0.13.0,>=0.12.0, pytest<8.0.0,>=7.4.4, redis<5.0.0,>=4.6.0, types-redis<5.0.0,>=4.6.0.20240425, types-requests<3.0.0,>=2.32.0.20240622, urllib3<3.0.0,>=2.2.2, xxhash<4.0.0,>=3.4.1' failed with exit code 1.
stdout:
stderr:
pid 32450 -> /path/to/python -sE /path/to/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --isolated -q --cache-dir /path/to/cache/pex_root/pip/24.0/pip_cache --log /path/to/log/pex-pip-log.log download --dest /path/to/cache/pex_root/downloads/resolver_download/usr.bin.python3.12 dependency-injector-fork<5.0.0,>=4.42.1 google-cloud-pubsub<3.0.0,>=2.21.5 google-cloud-storage<3.0.0,>=2.17.0 pulsar-client<4.0.0,>=3.5.0 pydantic<2.0.0,>=1.10.10 pytest-emulators-ewx<0.13.0,>=0.12.0 pytest<8.0.0,>=7.4.4 redis<5.0.0,>=4.6.0 types-redis<5.0.0,>=4.6.0.20240425 types-requests<3.0.0,>=2.32.0.20240622 urllib3<3.0.0,>=2.2.2 xxhash<4.0.0,>=3.4.1 --index-url <https://pypi.org/simple/> --extra-index-url <https://example.com/python-private/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
ERROR: Could not find a version that satisfies the requirement pytest-emulators-ewx<0.13.0,>=0.12.0 (from versions: none)
ERROR: No matching distribution found for pytest-emulators-ewx<0.13.0,>=0.12.0
So I guess the question is. How do I use Pants with a requirement that lives in a private Google Artifact Registry repo?
I also like to understand what's happening: Idon't completely get how Pants is telling pex what (to tell pip what) to do. I can't recreate it with vanilla pex for example. (Complains that --extra-index-url
is not a valid flag. Which is correct, that's a pip flag.curved-television-6568
07/07/2024, 5:29 AMpants.toml
?
https://www.pantsbuild.org/2.21/reference/subsystems/python-repos#indexescalm-librarian-70577
07/07/2024, 9:23 PM--extra-index-url
curved-television-6568
07/08/2024, 7:47 AMpytest-emulators-ewx
that gets discarded.. but the (from versions: none)
seems to suggest not, so I'm all out of ideas on this one (not my area of expertise either..)calm-librarian-70577
07/08/2024, 8:33 AMhundreds-carpet-28072
07/08/2024, 11:33 AMpip
, maybe the internal config isn’t targeting keyring in the same way normal pip’s default config would? Could try playing around with keyring flag https://pip.pypa.io/en/stable/topics/authentication/#keyring-supportcalm-librarian-70577
07/08/2024, 12:05 PMcalm-librarian-70577
07/08/2024, 12:44 PMpip
used by Pants. I get the feeling I'm thinking about it the wrong way, but I can't figure out the right one.calm-librarian-70577
07/08/2024, 12:47 PMpex
executable is actually pip. Okey, I may have a lead now.calm-librarian-70577
07/08/2024, 3:09 PMkeyrings.google-artifactregistry-auth
to the Pants internal pip
(Before it runs. I can't just add it as a req.) Any idea how I can do that?calm-librarian-70577
07/08/2024, 3:55 PMkeyrings.google-artifactregistry-auth
is not available as a package to pip when its building, or it is but it somehow doesn't have access to the credentials.