pygerrit2 icon indicating copy to clipboard operation
pygerrit2 copied to clipboard

"setup_requires" in setup.py doesn't follow pip --index-url

Open thombet opened this issue 3 years ago • 0 comments

Hello,

We ran into an problem today when trying to install pygerrit2. In our company we have a strict proxy policy which prevents us from downloading pip packages from the official public PyPI repository. Instead we have a company mirror of PyPI that we can use when calling pip: we only need to provide the argument --index-url (details).

Nevertheless, when calling pip install --index-url <server_url> -r requirements.txt where requirements.txt contain pygerrit2 we got an error because when installing pygerrit2, the command python setup.py egg_info tries to download pdb from the public PyPI instead of our company mirror. In other words the argument --index-url is ignored when the setup.py of pygerrit2 is run.

It looks like the problem comes from the use of setup_requires in pygerrit setup.py as explained here and here. Extracts:

WARNING
Beware of the setup_requires keyword arg in setup.py.
The (rare) packages that use it will cause those dependencies to be downloaded by setuptools directly,
skipping pip’s hash-checking. If you need to use such a package, see Controlling setup_requires.

To workaround this issue we had to create a .pydistutils.cfg file with index-url but I thought you would want to fix this as other users may face similar issues.

I am not sure why it was not reported before by the way because it looks like it was reported in other pip packages: https://www.twistedmatrix.com/trac/ticket/9189

thombet avatar Feb 16 '22 14:02 thombet