File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change
1
+ import setuptools .extern .jaraco .text as text
2
+
3
+ from pkg_resources import Requirement
4
+
5
+
6
+ def parse_strings (strs ):
7
+ """
8
+ Yield requirement strings for each specification in `strs`.
9
+
10
+ `strs` must be a string, or a (possibly-nested) iterable thereof.
11
+ """
12
+ return text .join_continuation (map (text .drop_comment , text .yield_lines (strs )))
13
+
14
+
15
+ def parse (strs ):
16
+ """
17
+ Deprecated drop-in replacement for pkg_resources.parse_requirements.
18
+ """
19
+ return map (Requirement , parse_strings (strs ))
Original file line number Diff line number Diff line change 37
37
38
38
import setuptools
39
39
import distutils
40
-
41
- import setuptools .extern .jaraco .text as text
40
+ from ._reqs import parse_strings
42
41
43
42
__all__ = ['get_requires_for_build_sdist' ,
44
43
'get_requires_for_build_wheel' ,
49
48
'SetupRequirementsError' ]
50
49
51
50
52
- def parse_requirements (strs ):
53
- """
54
- Yield requirement strings for each specification in `strs`.
55
-
56
- `strs` must be a string, or a (possibly-nested) iterable thereof.
57
- """
58
- return text .join_continuation (map (text .drop_comment , text .yield_lines (strs )))
59
-
60
-
61
51
class SetupRequirementsError (BaseException ):
62
52
def __init__ (self , specifiers ):
63
53
self .specifiers = specifiers
64
54
65
55
66
56
class Distribution (setuptools .dist .Distribution ):
67
57
def fetch_build_eggs (self , specifiers ):
68
- specifier_list = list (parse_requirements (specifiers ))
58
+ specifier_list = list (parse_strings (specifiers ))
69
59
70
60
raise SetupRequirementsError (specifier_list )
71
61
You can’t perform that action at this time.
0 commit comments