madpah / requirements-parser

A Pip requirements file parser.
https://requirements-parser.readthedocs.io
Apache License 2.0
125 stars 41 forks source link

Fix parsing lines using -e and end of line comments #27

Closed belak closed 4 years ago

belak commented 8 years ago

This is what I noticed when working with #25. I think this is the more proper fix. The test files are the same as editable_1, but with # Test comment on the end of all of them.

belak commented 8 years ago

The existing test failures are also failing on the master branch...

davidfischer commented 8 years ago

Master is back to working. Flake8 3.0 dropped support for Python2.6 which broke the tests.

belak commented 8 years ago

I've rebased against master. It appears to fix tests, but I still can't get them to run locally.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.03%) to 97.872% when pulling 95006a3dd1343fee721ae479deb53083530edac8 on belak:belak/editable-eol-comments into 4a43544dfc22cd08835ddbf8b920b7e5a3e3b283 on davidfischer:master.

davidfischer commented 7 years ago

Interestingly, there's a very old issue (#3) about parsing end of line comments. At that time, those types of comments were incidentally supported by pip and not technically part of their spec. However, it looks like that has since changed.

A line that begins with # is treated as a comment and ignored. Whitespace followed by a # causes the # and the remainder of the line to be treated as a comment.