Richard Knop
Richard Knop

Reputation: 83697

How to pip install git repository with requirements

So I have a common library repository which looks something like:

common
    __init__.py
    foo
        __init__.py
        bar.py
README.md
requirements.txt
setup.py

In a separate project I have it in requirements.txt like this:

git+https://github.com/something/something.git#egg=common

When I do pip install it installs it to:

venv
    src
        common

The problem is, the common library has its own requirements.txt file.

How to tell pip to install requirements of the external library?

Upvotes: 2

Views: 2970

Answers (2)

Alex Couper
Alex Couper

Reputation: 930

When you pip install it uses setup.py of the downloaded package to find dependencies, as opposed to running "-r requirements.txt".

Changing the setup.py of common to define dependencies is what you're after.

For an example of defining install_requires in your setup.py file, see the Hitchhiker's Guide to Packaging.

Upvotes: 1

James Mills
James Mills

Reputation: 19030

pip -r <file|url> supports eitehr a local file or a url. e.g:

pip install -r http://localhost:8080/requirements.txt

Tested and confirmed.

Upvotes: 0

Related Questions