Have you managed to use distribute successfully with GitHub, particularly for private repositories?

I developed a lightweight framework for our web service and hosted it in a private GitHub repository. I included this repository in the dependency_links section and double-checked that it appears correctly in dependency_links.txt.

When I attempt to run python setup.py install, I receive the error unknown url type: git+ssh. After further investigation, I discovered that distribute only supports svn+ URL types. I had assumed that distribute utilized pip, but it appears to still rely on easy_install.

I’m looking for advice on how to effectively use distutils or distribute for installing private GitHub repositories as dependencies. Here’s a brief code snippet illustrating my current approach:

from setuptools import setup, find_packages

setup(
    name='my-web-service',
    version='1.0.0',
    packages=find_packages(),
    install_requires=[
        'requests>=2.0.0',
        'my-lightweight-framework>=1.0.0',
    ],
    dependency_links=[
        'git+ssh://[email protected]/myorganization/my-lightweight-framework.git#egg=my-lightweight-framework-1.0.0'
    ]
)

Is there a method to configure distutils for private GitHub repositories, or should I consider another solution?

totally get your struggle! git+ssh can be a real pain with setup.py. you might wanna look into using pip with a requirements.txt for your git dependencies instead. it makes managing everything easier and keeps setup.py neat for PyPI stuff.

Honestly, just ditch dependency_links entirely - it’s broken with newer pip versions anyway. I switched to pip-tools and pin exact commit hashes in requirements.in, then generate a locked requirements.txt. Way more reliable than fighting with setup.py.

Been wrestling with this exact issue for months at my company. Switching to editable installs during development fixed it for us. Run pip install -e git+ssh://[email protected]/myorganization/my-lightweight-framework.git#egg=my-lightweight-framework - this installs the package in development mode. For production, we use a two-step process: install private dependencies with pip first, then run setup.py for the main package. Not elegant but works reliably. Also, use environment variables in your CI/CD pipeline for SSH keys - authentication issues with private repos are brutal to debug.

The dependency_links approach is deprecated and doesn’t work with modern pip. Skip setup.py for git dependencies and use pip directly instead. Just run pip install git+ssh://[email protected]/myorganization/my-lightweight-framework.git and keep only PyPI packages in your install_requires. Better yet, build your framework into a wheel file and host it on a private PyPI server or store wheels in a separate repo. This kills the git+ssh dependency problems and gives you proper version control.