Skip to content

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

@jcugat

Description

@jcugat

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 git@github.com: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 git+git@github.com:jcugat/tmp-minimal.git@60ec9d641516ce59d5f2f65a5f4163ba8d7af559#egg=minimal
$ pip uninstall -y -r requirements.txt
ERROR: git+git@github.com: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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: freeze'pip freeze' relatedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions