Pip ignores dependency_links installing package from wheel if PyPI dependency exists

I am packaging my own Python package. I am using setuptools and a wheel to bundle it and install it to install (both in development mode and from a PyPI test repository).

Every pip command to install packages is used here --process-dependency-links

. I will decrease this parameter for simplicity, and this parameter will be implicit here.

One of the dependencies was broken in PyPI, but the development repository issue has been fixed. I know what fixes fix this problem, I know its SHA-1 sum, so I know which tarball to download. So I did this in the setup.py file:

...
install_requires=[
    'hbmqtt>0.9.0'
],
dependency_links=[
    'https://github.com/beerfactory/hbmqtt/archive/f4330985115e3ffb3ccbb102230dfd15bb822a72.zip#egg=hbmqtt-0.9.1'
],
...

      

While I install the package in development mode (both via setuptools and pip), the package is downloaded from the git repo. Then I can redistribute the source code for my package.

python setup.py sdist
twine upload -s --sign-with gpg2 -r testpypi dist/<pkg-name>-<version>.tar.gz

      

Then I can install it from PyPI. If I don't set the options --no-cache-dir

and --no-binary :all:

at the same time ( --no-cache-dir

only needed to make sure the package is not installed from the cache) the first install looks OK. Pip downloads sources and then makes a wheel. Dependency resolution is going well, everything looks fine. Pip downloads the appropriate version (in my example) of the HBMQTT package and installs it. At the same time pip makes a wheel and then caches it. So the second installation (without option --no-binary

for obvious reason and with parameters --upgrade

and-I

) fails due to an unmet requirement: pip cannot find the HBMQTT package with version 0.9.1. The latest version of HBMQTT in PyPI is 0.9.0. So pip does not handle dependency links when trying to install from a wheels package.

The same happens when I try to make a wheel (python setup.py bdist_wheel) and load it into a test PyPI. Installation from PyPI fails and also from downloaded (or made by me) wheel file.

I believe the problem is in the pip or wheel. I do not know which one is responsible for the installation from the wheel.

And so my question is - what should I do now? What workarounds are there for this case? I only think of deploying the HBMQTT repository and building my own package until PyPI breaks the package.

+3


source to share


1 answer


Have you tried the flag --process-dependency-link

?

https://github.com/pypa/pip/issues/4295



Edit: sorry, now I can see you tried this. This solved the problem for me, but it is not very helpful for you.

0


source







All Articles