Skip to content

Commit

Permalink
fix: prevent crash when editable fragment references a tag
Browse files Browse the repository at this point in the history
- fragment parser was crashing on things like `#egg=simple==v1.0.0`
  • Loading branch information
darscan committed Mar 15, 2018
1 parent f0182e5 commit 85d3f44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plug/requirements/fragment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# MODIFIED - Replace/Update with care

import re

# Copied from pip
Expand All @@ -14,7 +16,7 @@ def parse_fragment(fragment_string):

try:
return dict(
key_value_string.split('=')
key_value_string.split('==')[0].split('=')
for key_value_string in fragment_string.split('&')
)
except ValueError:
Expand Down
2 changes: 1 addition & 1 deletion test/workspaces/pip-app-deps-editable/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-e git+https://github.com/snyk-fixtures/python-pypi-package-simple#egg=simple
git+https://github.com/snyk-fixtures/python-pypi-package-simple@v1.0.0#egg=simple==v1.0.0
-e git+https://github.com/snyk-fixtures/python-pypi-package-sample-subdir#egg=sample&subdirectory=subdir
posix_ipc==1.0.0

0 comments on commit 85d3f44

Please sign in to comment.