madpah / requirements-parser

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

Support hash fragment in uri matcher (e.g `#md5=...`) #22

Closed mshenfield closed 7 years ago

mshenfield commented 8 years ago

The URI regular expression doesn't support hashes in the fragment portion. Because of this, these urls are ignored, and passed to pkg_resources parse, which fails in a confusing way.

import requirements
list(requirements.parse("http://pypi.python.org/packages/source/p/pytz/pytz-2012b.tar.gz#md5=6c47456aca37bec88b3c6f4b02db613a"))
# > RequirementParseError: Invalid requirement, parse error at "'://pypi.'"

Adding support for a hash fragment would be great!

davidfischer commented 8 years ago

These no longer fail after merging #23. However, I suppose it would be nice to try to get any additional information from the URL.

davidfischer commented 7 years ago

Thanks for fixing this in #24!