Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'pip freeze' generates VCS pseudo URL a la git+git@ #9625

Closed
1 task done
jcugat opened this issue Feb 19, 2021 · 2 comments · Fixed by #9822
Closed
1 task done

'pip freeze' generates VCS pseudo URL a la git+git@ #9625

jcugat opened this issue Feb 19, 2021 · 2 comments · Fixed by #9822
Labels
C: freeze 'pip freeze' related type: bug A confirmed bug or unintended behavior

Comments

@jcugat
Copy link

jcugat commented Feb 19, 2021

pip version

21.0.1

Python version

Python 3.7.6

OS

macOS Catalina

Additional information

No response

Description

Starting from pip 21.0 the editable format printed by pip freeze can't be sent back to pip uninstall to remove an editable VCS package.

Expected behavior

Be able to remove those packages like it was possible in pip 20.3.4 and earlier.

How to Reproduce

  1. Clone a repo with a python package
  2. Install the package in editable form
  3. Run pip freeze
  4. Try to uninstall from the pip freeze output

Output

$ git clone [email protected]:jcugat/tmp-minimal.git
Cloning into 'tmp-minimal'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), done.
$ cd tmp-minimal/
$ pip --version
pip 21.0.1 from /Users/josepcugat/.pyenv/versions/3.7.6/envs/tmp-minimal/lib/python3.7/site-packages/pip (python 3.7)
$ pip install -e .
Obtaining file:///Users/josepcugat/workspace/tmp-minimal
Installing collected packages: minimal
  Running setup.py develop for minimal
Successfully installed minimal
$ pip freeze > requirements.txt
$ cat requirements.txt
-e [email protected]:jcugat/tmp-minimal.git@60ec9d641516ce59d5f2f65a5f4163ba8d7af559#egg=minimal
$ pip uninstall -y -r requirements.txt
ERROR: [email protected]:jcugat/tmp-minimal.git@60ec9d641516ce59d5f2f65a5f4163ba8d7af559#egg=minimal is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
$ pip install pip==20.3.4
Collecting pip==20.3.4
  Using cached pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.0.1
    Uninstalling pip-21.0.1:
      Successfully uninstalled pip-21.0.1
Successfully installed pip-20.3.4
$ pip uninstall -y -r requirements.txt
Found existing installation: minimal 0.1
Uninstalling minimal-0.1:
  Successfully uninstalled minimal-0.1

Code of Conduct

  • I agree to follow the PSF Code of Conduct

I think this is related to the removal in this PR #7554
It's a bit weird that the same format that pip freeze outputs it's considered invalid for pip uninstall.

@jcugat jcugat added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Feb 19, 2021
@uranusjr
Copy link
Member

The problem is not in uninstall, but freeze is generating an incorrect URL. The “pseudo URL” format was a historical error and was removed in #7554.

@uranusjr uranusjr changed the title Uninstall not working for editable VCS installs 'pip freeze' generates VCS pseudo URL a la git+git@ Feb 19, 2021
@uranusjr uranusjr added C: freeze 'pip freeze' related and removed S: needs triage Issues/PRs that need to be triaged labels Feb 19, 2021
@bwoodsend
Copy link
Contributor

I'm going to give this one a go...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: freeze 'pip freeze' related type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants