I am creating a setup.py
file for a project which depends on private GitHub repositories. The relevant parts of the file look like this:
from setuptools import setup
setup(name='my_project',
...,
install_requires=[
'public_package',
'other_public_package',
'private_repo_1',
'private_repo_2',
],
dependency_links=[
'https://github.com/my_account/private_repo_1/master/tarball/',
'https://github.com/my_account/private_repo_2/master/tarball/',
],
...,
)
I am using setuptools
instead of distutils
because the latter does not support the install_requires
and dependency_links
arguments per this answer.
The above setup file fails to access the private repos with a 404 error - which is to be expected since GitHub returns a 404 to unauthorized requests for a private repository. However, I can't figure out how to make setuptools
authenticate.
Here are some things I've tried:
Use
git+ssh://
instead ofhttps://
independency_links
as I would if installing the repo withpip
. This fails because setuptools doesn't recognize this protocol ("unknown url type: git+ssh"), though the distribute documentation says it should. Dittogit+https
andgit+http
.https://<username>:<password>@github.com/...
- still get a 404. (This method doesn't work withcurl
orwget
from the command line either - thoughcurl -u <username> <repo_url> -O <output_file_name>
does work.)Upgrading setuptools (0.9.7) and virtualenv (1.10) to the latest versions. Also tried installing distribute though this overview says it was merged back into setuptools. Either way, no dice.
Currently I just have setup.py
print out a warning that the private repos must be downloaded separately. This is obviously less than ideal. I feel like there's something obvious that I'm missing, but can't think what it might be. :)
Duplicate-ish question with no answers here.
ssh://
and run intoCould not resolve hostname
change the:
to/
in your clone url. I had this error with gitlab. – Sorority