python - Installing dependent Github-based packages with pip -
i have python repo on github setup.py , requirements.txt. originally, setup.py contained this:
setup( ... install_requires=[x x in open("requirements.txt").read().splitlines() if "://" not in x], dependency_links=[x x in open("requirements.txt").read().splitlines() if "://" in x] ) when did pip install git+https://github.com/foo/bar.git@branch#egg=foo repo, correctly installs install_requires dependencies, ignores additional github-based dependencies in dependency_links.
after lot of investigation -- stackoverflow, #python , docs (fwiw) -- there's suggestion dependency_links deprecated , should put install_requires. change setup.py to:
setup( ... install_requires=open("requirements.txt").read().splitlines() ) now pip complains, whenever gets github-based dependency -- let's call quux -- it's expecting "version spec". i've tried:
git+https://github.com/foo/quux.git@branch#egg=quux==0.1.0git+https://github.com/foo/quux.git@branch#egg=quux#version==0.1.0git+https://github.com/foo/quux.git@branch#egg=quux&version==0.1.0
...as without version specified, both , without preceding -e in requirements.txt , keep getting error. i've tried different formats url scheme, without difference.
how format requirements.txt , setup.py deal git-based dependencies?
what worked me running pip install --process-dependency-links ... setup.py file:
setup( ... install_requires=[ 'my_lib==0.1.0', ], dependency_links=[ 'git+ssh://git@github.com/foo/quux.git@branch#egg=my_lib-0.1.0', ] ) note said, --dependency_links deprecated, , removed in future release of pip. in case don't know solution be.
Comments
Post a Comment