Open
Description
Description
We are using Google Artifact Registry to install packages. Using a combination of --no-input
and --keyring-provider=import
works for installing wheels from GAR, but it does not work when installing a package from source as the requirements in the build-system.requires
does not use the keyring auth.
Expected behavior
When pip install requirements for build-system.requires
, it should use the same keyring behavior as installing a package normally.
pip version
23.3.1
Python version
3.10.13 (Docker, official image)
OS
Debian Bullseye (Docker, official image)
How to Reproduce
- Add a private repo that requires keyring auth to pip config:
[global]
index-url = https://url/to/repo
- Install keyring and setup keyring auth (example with Google Artifact Registry)
pip install keyring keyrings-google-artifactregistry-auth
- Verify keyring auth is working with
--no-input
(install package with wheel)
pip install --no-input --keyring-provider=import requests
- Try to install a package from source/tarball.
flake8-mutable
looks like it works as a test package as it does not have a wheel, but you can pip install a source directory as well.
pip install --no-input --keyring-provider=import flake8-mutable
Output
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
/usr/local/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
ERROR: Could not find a version that satisfies the requirement pytest-runner (from versions: none)
ERROR: No matching distribution found for pytest-runner
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
subprocess.check_call(cmd)
File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp01v07qq3', '--quiet', 'pytest-runner']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-35h5zefc/flake8-mutable_09876f5ce1344b51b1270e2d9407a954/setup.py", line 5, in <module>
setuptools.setup(
File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 789, in resolve
dist = best[req.key] = env.best_match(
File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
return fetch_build_egg(self, req)
File "/usr/local/lib/python3.10/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['/usr/local/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp01v07qq3', '--quiet', 'pytest-runner']' returned non-zero exit status 1.
[end of output]
Code of Conduct
- I agree to follow the PSF Code of Conduct.