pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.39k stars 2.99k forks source link

`pip freeze` fails on git-svn projects #223

Closed vbabiy closed 7 years ago

vbabiy commented 13 years ago

i have many projects checked out from a Subversion repo using git-svn and installed via pip -E /path/to/my/env install -e .. this works great except when i want to do a pip freeze:

#!Bash

$ pip -E /path/to/my/env freeze                              
Exception:                                                                           
Traceback (most recent call last):                                                   
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/basecommand.py", line 130, in main                                                                 
    self.run(options, args)                                                          
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/commands/freeze.py", line 68, in run                                                               
    req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)                                                                                    
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/__init__.py", line 141, in from_dist                                                               
    req = get_src_requirement(dist, location, find_tags)                             
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/vcs/__init__.py", line 236, in get_src_requirement                                                 
    return version_control().get_src_requirement(dist, location, find_tags)          
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/vcs/subversion.py", line 230, in get_src_requirement                                               
    repo = self.get_url(location)
  File "/usr/local/lib/python2.6/dist-packages/pip-0.8.1-py2.6.egg/pip/vcs/subversion.py", line 189, in get_url
    f = open(os.path.join(location, self.dirname, 'entries'))
IOError: [Errno 2] No such file or directory: '/path/to/some/project/.svn/entries'

(file paths replaced with dummies)

it seems that pip is incorrectly treating the projects as Subversion projects, whereas they are actually (locally) Git projects.


vbabiy commented 13 years ago

more recently, i get this instead:

$ pip -E /path/to/my/env freeze

Command /usr/bin/git config remote.origin.url failed with error code 1

Storing complete log in /path/to/my/home/.pip/pip.log

$ cat /path/to/my/home/.pip/pip.log

------------------------------------------------------------

/usr/local/lib/python2.6/dist-packages/pip-0.8.2-py2.6.egg/pip/runner.py

run on Fri Dec 17 15:07:59 2010

Found command 'git' at '/usr/bin/git'

Running command /usr/bin/git config remote.origin.url

Command /usr/bin/git config remote.origin.url failed with error code 1

Exception information:

Traceback (most recent call last):

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/basecommand.py", line 130, in main

    self.run(options, args)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/commands/freeze.py", line 68, in run

    req = pip.FrozenRequirement.from_dist(dist, dependency_links,

find_tags=find_tags)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/init.py", line 141, in from_dist

    req = get_src_requirement(dist, location, find_tags)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/vcs/init.py", line 238, in get_src_requirement

    return version_control().get_src_requirement(dist, location,

find_tags)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/vcs/git.py", line 149, in get_src_requirement

    repo = self.get_url(location)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/vcs/git.py", line 114, in get_url

    show_stdout=False, cwd=location)

  File "/usr/local/lib/python2.6/dist-

packages/pip-0.8.2-py2.6.egg/pip/init.py", line 249, in call_subprocess

    % (command_desc, proc.returncode))

InstallationError: Command /usr/bin/git config remote.origin.url failed

with error code 1

now it looks like pip recognizes the projects as Git projects, but it seems to expect a non-empty list of remotes. not having any remotes is normal even in Git projects that aren't git-svn projects, but it is especially typical of git-svn projects. if pip really wants the git-svn origin repo, perhaps it should parse the output of git svn info.


Original Comment By: Anonymous
razamatan commented 13 years ago

i think a fix would be to issue this command on git repos that are recognized as git svn checkouts to fetch the url:

git config svn-remote.svn.url

in the interim, i got around this issue by "creating" the origin remote branch by spoofing things to point to the checkout itself.

(from the repo root) git remote add origin .

gregglind commented 12 years ago

Anyone assigned to this yet? What is it that pip wants out of this info? I would be happy to work on it once I grok why pip cares what the remotes are!

razamatan commented 12 years ago

i don't think anyone is assigned. the basic idea is that pip wants a url for the checkout, and the current way of doing it is fragile when having a git-svn repo. i suggested other git commands that would return a url in a non-fragile way (i think). i'm by no means a git expert, so consider my suggestions as just that... a suggestion an d not a fix.

dstufft commented 7 years ago

Closing this. It's had no activity in 6 years and I believe the trigger for this is esoteric enough that it doesn't make sense to try and support it.