Skip to content

Commit

Permalink
fix: handle backslash line splitter
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-go committed Feb 1, 2018
1 parent 2bfa8b8 commit 948addc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions plug/requirements/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def parse(reqstr):
if not isinstance(reqstr, str):
reqstr = reqstr.read()

# combine consecutive lines seperated by a backslash
reqstr = reqstr.replace('\\\n', ' ');

for line in reqstr.splitlines():
line = line.strip()
if line == '':
Expand Down
4 changes: 3 additions & 1 deletion test/workspaces/pip-app-deps-with-hashes/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
MarkupSafe==1.0 --hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665
MarkupSafe==1.0 --hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665 \
--hash=sha256:abcd \
--hash=sha256:0123 # a comment
dnspython==1.13.0 --hash=sha256:80f89881b402fc3b931a936111b43bcfe3abd8b0005d27e50e3c5fb59f7260f8

0 comments on commit 948addc

Please sign in to comment.