ccgillett ccgillett - 3 months ago 10
Git Question

Configuring so that pip install can work from github

We'd like to use pip with github to install private packages to our production servers. This question concerns what needs to be in the github repo in order for the install to be successful.

Assuming the following command line (which authenticates just fine and tries to install):

pip install git+ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName


What needs to reside in the ProductName? Is it the contents of what would normally be in the tar file after running setup.py with the sdist option, or is the actual tar.gz file, or something else?

I'm asking here because I've tried several variations and can't make it work. Any help appreciated.

Answer

You need the whole python package, with a setup.py file in it.

A package named foo would be:

foo # the installable package
├── foo
│   ├── __init__.py
│   └── bar.py
└── setup.py

And install from github like:

$ pip install git+git://github.com/myuser/foo.git@v123
or
$ pip install git+git://github.com/myuser/foo.git@newbranch

More info at http://www.pip-installer.org/en/latest/reference/pip_install.html#vcs-support