_reqs.py 501 B

12345678910111213141516171819
  1. import setuptools.extern.jaraco.text as text
  2. from pkg_resources import Requirement
  3. def parse_strings(strs):
  4. """
  5. Yield requirement strings for each specification in `strs`.
  6. `strs` must be a string, or a (possibly-nested) iterable thereof.
  7. """
  8. return text.join_continuation(map(text.drop_comment, text.yield_lines(strs)))
  9. def parse(strs):
  10. """
  11. Deprecated drop-in replacement for pkg_resources.parse_requirements.
  12. """
  13. return map(Requirement, parse_strings(strs))