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

Created on 3 Oct 2017  ·  6Comments  ·  Source: pypa/pip

  • 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
editable freeze vcs auto-locked bug

Most helpful comment

I just stumbled on this. I concur that a Git repository without a remote is a viable installation candidate.

All 6 comments

Thanks for filing this @cboylan!

@cjerdonek I think you'd know a bit more about this than I do -- did this get fixed at some point?

Nvm. Ignore that comment. 🤷‍♂️

I just stumbled on this. I concur that a Git repository without a remote is a viable installation candidate.

Since this is a Git repo, it seems like the freeze output should include the SHA and not just the path, like it does for Git repos with remotes.

[Dec. 21, 2018: I have changed my opinion on this.]

I posted a new PR to address this issue: #6095. The PR addresses some issues I raised in the other PR #4760 and also takes advantage of a new argument to VersionControl.run_command() that I introduced in PR #5912.

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.

Was this page helpful?
0 / 5 - 0 ratings