Skip to content

Commit

Permalink
Fix bug with local file installs that are not marked editable = "true" (
Browse files Browse the repository at this point in the history
#342)

* Solve for case where its a file but user has not marked edtiable = 'true' in Pipfile entry.

* Add news fragment.
  • Loading branch information
matteius authored Aug 29, 2022
1 parent 774f5a4 commit fe2e4c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/342.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug with local file installs that are not marked ``editable = "true"`` getting an unexpected ``#egg`` fragment.
6 changes: 5 additions & 1 deletion src/requirementslib/models/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,11 @@ def get_line_instance(self):
else:
line_parts.append(self.req.line_part)
if not self.is_vcs and not self.vcs and self.extras_as_pip:
if self.is_file_or_url and not local_editable:
if (
self.is_file_or_url
and not local_editable
and not self.req.get_uri().startswith("file://")
):
line_parts.append(f"#egg={self.extras_as_pip}")
else:
line_parts.append(self.extras_as_pip)
Expand Down

0 comments on commit fe2e4c4

Please sign in to comment.