Skip to content

Commit 275e5e6

Browse files
committed
In build_meta, remove dependency on pkg_resources.
1 parent 430cacd commit 275e5e6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

setuptools/build_meta.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import setuptools
3939
import distutils
4040

41-
from pkg_resources import parse_requirements
41+
import setuptools.extern.jaraco.text as text
4242

4343
__all__ = ['get_requires_for_build_sdist',
4444
'get_requires_for_build_wheel',
@@ -49,14 +49,23 @@
4949
'SetupRequirementsError']
5050

5151

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+
5261
class SetupRequirementsError(BaseException):
5362
def __init__(self, specifiers):
5463
self.specifiers = specifiers
5564

5665

5766
class Distribution(setuptools.dist.Distribution):
5867
def fetch_build_eggs(self, specifiers):
59-
specifier_list = list(map(str, parse_requirements(specifiers)))
68+
specifier_list = list(parse_requirements(specifiers))
6069

6170
raise SetupRequirementsError(specifier_list)
6271

0 commit comments

Comments
 (0)