Skip to content

dependency_links flag ignored when package exists on PyPI #987

@smcolby

Description

@smcolby

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions