pypa/pip

Pip install git repo as egg fails when specifying target

varyag00 opened this issue · 4 comments

  • Pip version: 9.0.1, 8.1.2
  • Python version: 2.7, 3.5
  • Operating System: Mac OS X El Capitan

Description:

We have a python 2/3 compatible application and are using PyPI packages in conjunction with several private github repos. We're using a requirements.txt file to specify dependencies, in the form:

-e git://github.com/3ptscience/properties@dev#egg=<name> #OSS repo at a certain branch
-e git+ssh://git@github.com/3ptscience/project.git#egg=project # private repo
-e .

When run with pip install -r requirements.txt -t lib/ I expect the packages to get installed as eggs to the lib directory, however instead I get the following error:

$ pip install -r requirements.txt -t lib/
Installing collected packages: six, properties, pygelf, vine, amqp, kombu, logbook, metronome, webapp2, webob, future, audition, MarkupSafe, jinja2, jinja2-registry, mistune, minimals
  Found existing installation: properties 0.3.0b0
    Uninstalling properties-0.3.0b0:
      Successfully uninstalled properties-0.3.0b0
  Running setup.py develop for properties
    Complete output from command /Users/dan/anaconda/bin/python -c "import setuptools, tokenize;__file__='/Users/dan/git/testing/project/src/properties/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --home=/var/folders/84/18pfy09s333gylfsfmqkx0140000gn/T/tmpLiZsAN:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --home not recognized

    ----------------------------------------
  Rolling back uninstall of properties
Command "/Users/dan/anaconda/bin/python -c "import setuptools, tokenize;__file__='/Users/dan/git/testing/project/src/properties/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --home=/var/folders/84/18pfy09s333gylfsfmqkx0140000gn/T/tmpLiZsAN" failed with error code 1 in /Users/dan/git/testing/project/src/properties/

This happens for both private and public repos, with or without -e ., and with either multiple or a single repository listed in the requirements.txt (and all permutations thereof). It does not happen when I install a PyPI package such as pip install requests, even when installing from a requirements.txt to a target via pip install requirements_no_git.txt -t lib/ (as long as requirements.txt contains no git repos).

I am fairly sure the requirements.txt file is correctly formatted as running pip install -r requirements.txt succeeds and correctly installs the packages (even when containing git repos).

What I've run:

One workaround I've found works is to separate the deps into two requirements files, requirements.txt and requirements_no_git.txt, where requirements.txt contains all the git repos and ``requirements_dev.txtcontains all the PyPI packages. Then I simply run pip install requirements.txt`
Then rename the folder to lib
`mv src lib`
Then install the PyPI packages to the `lib` target
`pip install -r requirements.txt -t lib`

This gets generally the same results a simply installing all to lib/, but it is still inconvenient.

Closing to move a bunch of related issues to a single issue: #4390.

@varyag00 Does it work as expected if you remove the -e option from each line containing a source control url?

Looks like this is a duplicate of #562.

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.