Skip to content

Commit 768a5a5

Browse files
committed
Replace usage of internal pip function parse_requirements
Starting with pip 10 the `parse_requirement` function was explicitly moved to an internal namespace. In other words, using it is fraught with problems since there are no guarantees it won't move again, have its signature altered, or otherwise. Because of this, replace the use of the internal function with an equivalent function.
1 parent 51ff5f8 commit 768a5a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import versioneer
55

6-
from pip.req import parse_requirements
6+
from distutils.text_file import TextFile
77
from skbuild import setup
88

99

@@ -14,12 +14,13 @@
1414
history = fp.read().replace('.. :changelog:', '')
1515

1616

17-
def _parse_requirements(filename):
18-
return [str(ir.req) for ir in parse_requirements(filename, session=False)]
17+
def parse_requirements(filename):
18+
with open(filename, 'r') as file:
19+
return TextFile(filename, file).readlines()
1920

2021

2122
requirements = []
22-
dev_requirements = _parse_requirements('requirements-dev.txt')
23+
dev_requirements = parse_requirements('requirements-dev.txt')
2324

2425
# Require pytest-runner only when running tests
2526
pytest_runner = (['pytest-runner>=2.0,<3dev']

0 commit comments

Comments
 (0)