Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency_links flag ignored when package exists on PyPI #987

Closed
smcolby opened this issue Feb 25, 2017 · 17 comments
Closed

dependency_links flag ignored when package exists on PyPI #987

smcolby opened this issue Feb 25, 2017 · 17 comments
Labels
Needs Triage Issues that need to be evaluated for severity and status.

Comments

@smcolby
Copy link

smcolby commented Feb 25, 2017

I am relying on pyswarm for a package I am working on. PyPI's latest version is 0.6, but I need 0.7, which is only on GitHub. My stripped-down setup function is below:

from setuptools import setup, find_packages

setup(
    name='mypackage',
    version='0.1',
    packages=find_packages(exclude=('examples', 'docs')),
    install_requires=['pyswarm>=0.7'],
    dependency_links=[
        "git+https://github.com/tisimst/pyswarm",
    ]
)

As shown here, the install fails with:

$ pip install mypackage
...
Could not find a version that satisfies the requirement pyswarm>=0.7 (from mypackage==0.1) (from versions: 0.5, 0.6)
No matching distribution found for pyswarm>=0.7 (from mypackage==0.1)

However, installing via pip works perfectly fine, satisfying pyswarm>=0.7:

$ pip install git+https://github.com/tisimst/pyswarm
Collecting git+https://github.com/tisimst/pyswarm
  Cloning https://github.com/tisimst/pyswarm to /tmp/pip-0k6viimo-build
Requirement already satisfied: numpy in /home/sean/opt/anaconda3/lib/python3.5/site-packages (from pyswarm==0.7)
Installing collected packages: pyswarm
  Running setup.py install for pyswarm ... done
Successfully installed pyswarm-0.7

Why is dependency_links being ignored when setup() attempts to find pyswarm-0.7? It appears that versions 0.5 and 0.6 are found on PyPI (and do not satisfy the requirements), but version 0.7 is not found via the GitHub link despite the fact that pip installs from the same link just fine.

My current workaround is to run pip install git+https://github.com/tisimst/pyswarm via subprocess.call() before setup() is called (thus satisfying the pyswarm>=0.7 requirement), but this should not be necessary.

@jaraco
Copy link
Member

jaraco commented Mar 2, 2017

I don't know how dependency links work or how they're supposed to work. You'll need to dig into the docs and maybe the code and try to ascertain if what you're trying to do is supported and if so what needs to change to make it work.

@kampfschlaefer
Copy link

Hey @smcolby I just found your ticket here as I stumbled across a similar issue and googled.

Did you try to add #egg=pyswarm to the line in the dependency links? It solved my similar problem,

@krautcat
Copy link

krautcat commented Jul 27, 2017

I've been faced with the same problem. I tried almost any combination in link field (in dependency_links array). Here is fragment from my setup.py file.

...
install_requires=[
    'hbmqtt>0.9.0'
],
dependency_links=[
    'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt'
],
...

It doesn't solve the problem. Altough I can install hbmqtt package via pip from this link.

@benoit-pierre
Copy link
Member

It's because your missing a version in your link, since you ask for hbmqtt>0.9.0, either use:

install_requires=[
   'hbmqtt'
],
dependency_links=[
   'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt'
],

or better tag your link version, e.g.:

install_requires=[
    'hbmqtt>0.9.0'
],
dependency_links=[
    'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt-0.9.1.dev'
],

@krautcat
Copy link

krautcat commented Jul 27, 2017

Master branch has version tuple in __init__.py:

VERSION = (0, 9, 1, 'alpha', 0)

I suppose version string, appended to tag is 0.9.1alpha0. I don't know, is it important or no.
If use this:

install_requires=[
    'hbmqtt>0.9.0'
],
dependency_links=[
    'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt-0.9.1alpha0'
],

Setuptools doesn't use git repo.

...
Collecting hbmqtt>0.9.0 (from mockquitto==0.0.0.dev2)
  Could not find a version that satisfies the require hbmqtt>0.9.0 (from mockquitto==0.0.0.dev2) (from versions: 0.3.macosx-10.6-intel, 0.4.macosx-10.6-intel, 0.5.macosx-10.6-intel, 0.8.macosx-10.6-intel, 0.9.macosx-10.6-intel, 0.1, 0.2, 0.3, 0.4, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.3, 0.8.dev20160507052755, 0.8, 0.9) 

If I use link without tag, setuptools installs version from pypi.

install_requires=[
    'hbmqtt'
],
dependency_links=[
    'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt'
],

In my workflow I use pyenv-virtualenv and install locally from wheel package file.

pyenv deactivate && python setup.py bdist_wheel 
pyenv activate mockquitto-test-venv-system && pip install -I --process-dependency-links --no-cache-dir dist/mockquitto-0.0.0.dev2-py3-none-any.whl

@benoit-pierre
Copy link
Member

benoit-pierre commented Jul 27, 2017

hbmqtt's master identify itself as:

> python ./setup.py --version
0.9.1.dev20170707192538

so I think hbmqtt-0.9.1.dev is right. If you prefer to use alpha0, the correct syntax is hbmqtt-0.9.1.alpha0.

It does not seem to work when installing from wheel, however...

@benoit-pierre
Copy link
Member

Note that hbmqtt-0.9.1.alpha0 or hbmqtt-0.9.1.dev are pre-release versions, so pip's --pre flag must be used.

@krautcat
Copy link

krautcat commented Jul 27, 2017

Yes, I tried different notation (hbmqtt-0.9.1.alpha0 and hbmqtt-0.9.1.dev respectively) and tried --pre pip's flag. Nothing changes. Setuptools is still looking for required version of package in PyPI.

@krautcat
Copy link

krautcat commented Aug 1, 2017

Ok, I had investigated this issue and concluded that it's not the problem of setuptools, it's problem of pip or even wheel. I asked the question on SO. I hope this discussion will help anybody who has the same problem as mine.

@gijzelaerr
Copy link

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

pypa/pip#4295

@krautcat
Copy link

krautcat commented Nov 3, 2017

@gijzelaerr, if I can remember, this flag didn't help me.

@pganssle pganssle added the Needs Triage Issues that need to be evaluated for severity and status. label Oct 19, 2018
@rominf
Copy link

rominf commented Oct 29, 2018

Have the same problem. When will this be solved?

@jonas-eschle
Copy link

Similar problem here: The installation with the local setup.py (and the --process-dependency-link flag) works, but when the package is uploaded to pip it does not anymore.

@amirkav
Copy link

amirkav commented Dec 3, 2018

About dependency links:
pypa/pip#4187

@benoit-pierre
Copy link
Member

Closing, as dependency links support has been dropped in recent versions of pip.

@designerzim
Copy link

So what's the replacement? How are we supposed to support installation of packages from multiple indexes?

@jaraco
Copy link
Member

jaraco commented Sep 3, 2021

Questions about installation should be directed to pip or the pypa discussion groups. I don't have the official answer, but I believe the answer is use --extra-index-url or adopt/deploy and index like devpi that includes index inheritance and mirroring.

@pypa pypa locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests