6

I have one python package A which has depends on another private package named godot(hosted at bitbucket, and should be accessed by git+ssh protocol). In package A's setup.py, I have following code:

...
install_requires=['godot'],
dependency_links=['git+ssh://git@bitbucket.org/xxx/godot.git#egg=godot']
...

I have two questions here:

  1. Now setuptools 1.4 (latest stable version) does not support 'git+ssh' protocol, only code in the development branch handle this protocol: Python setuptools: How can I list a private repository under install_requires?. I have installed the development version via:

    pip install --upgrade --force-reinstall hg+https://bitbucket.org/pypa/setuptools#egg=setuptools

    I almost solved this bit, but I wonder If any other approach available? Invoke pip install -r requirements.txt(have git+ssh://git@bitbucket.org/xxx/godot.git#egg=godot list in requirements.txt)?

  2. The second question is name conflict. There is another package on pypi also named godot, So when I install package A using follow command, pip install the godot from pypi index:

    pip install git+ssh://git@pypi.corp.com/xxx/A.git#egg=A

    How could force pip(setup.py) to install the private godot package, rather than the one on pypi index?

Community
  • 1
  • 1
schemacs
  • 2,783
  • 8
  • 35
  • 53

2 Answers2

1

For part 1: you can install packages via pip by specifying as:

$ pip install http://my.package.repo/SomePackage-1.0.4.zip

To keep it simple and avoid spending undue time on it, I would just download the .zip source file and install via pip as above.

See here...

For part 2: pip has a --no-dependencies switch. Add that after installing all the dependencies manually

Alexander McFarlane
  • 10,643
  • 9
  • 59
  • 100
1

I know this is an old topic, but it might help people coming across it through google search:

Actually, for part 2, you can simply define the package adress inside the install_requires part:

...
install_requires=['godot @ git+ssh://bitbucket.org/xxx/godot.git#egg=godot']
...
Serge
  • 11
  • 2