-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move requirements processing to _reqs module. Add parse function.
- Loading branch information
Showing
2 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import setuptools.extern.jaraco.text as text | ||
|
||
from pkg_resources import Requirement | ||
|
||
|
||
def parse_strings(strs): | ||
""" | ||
Yield requirement strings for each specification in `strs`. | ||
`strs` must be a string, or a (possibly-nested) iterable thereof. | ||
""" | ||
return text.join_continuation(map(text.drop_comment, text.yield_lines(strs))) | ||
|
||
|
||
def parse(strs): | ||
""" | ||
Deprecated drop-in replacement for pkg_resources.parse_requirements. | ||
""" | ||
return map(Requirement, parse_strings(strs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters