Skip to content

Non-VCS editable installs don’t freeze to editable requirements #5031

@mforkel

Description

@mforkel
  • Pip version: 9.0.1
  • Python version: 2.7.14
  • Operating system: Ubuntu 17.10

Description:

I'm using local projects, i.e. non-VCS "editable" installs, in virtual environments during development. pip freeze translates them into requirements like
<name>==<vers>
instead of
-e <path>
This makes it hard to re-make the virtual environment based on the requirements recorded by pip freeze.

A naive fix would be

--- pip/__init__.py.orig	2018-02-17 11:34:52.767000000 +0100
+++ pip/__init__.py	2018-02-17 11:29:44.659000000 +0100
@@ -271,6 +271,13 @@
                 )
                 req = dist.as_requirement()
                 editable = False
+        elif dist_is_editable(dist) and not vcs.get_backend_name(location):
+            editable = True
+            req = location
+            comments.append(
+                '# Using local project as editable install to satisfy requirement'
+            )
+        else:
             editable = False
             req = dist.as_requirement()
             specs = req.specs

Why are local projects seemingly not supported in pip freeze?

May be my question on Stack Overflow regarding this issue helps to explain my intention.

Metadata

Metadata

Assignees

Labels

C: editableEditable installationsC: freeze'pip freeze' relatedauto-lockedOutdated issues that have been locked by automationtype: enhancementImprovements to functionality

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions