Skip to content

pip freeze errors when packages are pip install -e'd against git repos with no remote #4759

@cboylan

Description

@cboylan
  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating system: Linux (SUSE Tumbleweed)

Description:

If I pip install -e against a git repo with no remotes then pip freeze will error when reporting the version for that package because it claims to not know the repo location.

What I've run:

clark@morbo:~/tmp$ virtualenv testenv
New python executable in /home/clark/tmp/testenv/bin/python2
Also creating executable in /home/clark/tmp/testenv/bin/python
Installing setuptools, pip, wheel...done.
clark@morbo:~/tmp$ testenv/bin/pip --version
pip 9.0.1 from /home/clark/tmp/testenv/lib/python2.7/site-packages (python 2.7)
clark@morbo:~/tmp$ testenv/bin/pip install -e git/git-review
Obtaining file:///home/clark/tmp/git/git-review
Collecting requests>=1.1 (from git-review==1.25.1.dev52)
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests>=1.1->git-review==1.25.1.dev52)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests>=1.1->git-review==1.25.1.dev52)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=1.1->git-review==1.25.1.dev52)
  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=1.1->git-review==1.25.1.dev52)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: idna, urllib3, certifi, chardet, requests, git-review
  Running setup.py develop for git-review
Successfully installed certifi-2017.7.27.1 chardet-3.0.4 git-review idna-2.6 requests-2.18.4 urllib3-1.22
clark@morbo:~/tmp$ testenv/bin/pip freeze
Complete output from command git config --get-regexp remote\..*\.url:

----------------------------------------
Error when trying to get requirement for VCS system Command "git config --get-regexp remote\..*\.url" failed with error code 1 in /home/clark/tmp/git/git-review, falling back to uneditable format
Could not determine repository location of /home/clark/tmp/git/git-review
certifi==2017.7.27.1
chardet==3.0.4
## !! Could not determine repository location
git-review==1.25.1.dev52
idna==2.6
requests==2.18.4
urllib3==1.22

What I expect

It is perfectly valid to have a git repo with no remotes. That just means the current repo is canonical. Instead of erroring pip should use the file location as the location of the repo. Something like:

git+file:///path/to/package/repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: editableEditable installationsC: freeze'pip freeze' relatedC: vcspip's interaction with version control systems like git, svn and bzrauto-lockedOutdated issues that have been locked by automationtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions