9

I am packaging my own Python package. I use setuptools and wheel for bundling it and pip for installing (both in develop mode and from test PyPI repository).

Every pip command for installing packages is used with --process-dependency-links here. I will let down this option for simplifying and this option will be implicit here.

One of the dependencies is broken in PyPI but in development repository issue has been fixed. I know which commit fixes this issue, I know its SHA-1 sum, so I know which tarball to download. So I did this in my 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 package in development mode (both via setuptools and pip), package is downloaded from git repo. Then I can distribute source code of 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 --no-cache-dir and --no-binary :all: options simultaneously (--no-cache-dir is needed only to make sure that the package is not installed from the cache), first installation looks OK. Pip downloads sources and then make wheel. Resolving dependencies goes well, everything looks OK. Pip downloads appropriate version of (in my example) HBMQTT package and installs it. At the same time pip makes wheel and then caches it. So second installation (without --no-binary option for obvious reason and with --upgrade and -I options) fails due to unsatisfied requirement: pip cannot find HBMQTT package with version 0.9.1. Latest version of HBMQTT in PyPI is 0.9.0. So pip doesn't process dependency links when trying to install from wheel package.

Same thing happens when I'm trying to make wheel (python setup.py bdist_wheel) and upload it on test PyPI. Installation from PyPI fails as well as from downloaded (or made by me) wheel file.

I suppose that trouble is located in pip or wheel. I don't know which one is responsible for installing from wheel.

And so my question is what I should do now? Which workarounds do exist for this case? I think only about forking HBMQTT repo and making my own package until PyPI has broken package.

phd
  • 82,685
  • 13
  • 120
  • 165
krautcat
  • 91
  • 4

1 Answers1

-1

did you try the --process-dependency-link flag?

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

edit: sorry, i see now that you tried that. For me this solved the problem, but that is not very useful for you.

Gijs Molenaar
  • 405
  • 1
  • 3
  • 9