Skip to content

Commit c1b9fbd

Browse files
committed
Fixed requirements handling.
Do not depend on pip internal parsing of requirements.txt, reference setup.py from requirements instead. Same for requirements_dev.txt, but now use the extras_require and reference the 'testing' feature dependencies. See: https://caremad.io/posts/2013/07/setup-vs-requirement/ See: https://stackoverflow.com/a/27271396 Signed-off-by: Oldřich Jedlička <[email protected]>
1 parent 26fda36 commit c1b9fbd

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

requirements-dev.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# The order of packages is significant, because pip processes them in the order
2-
# of appearance. Changing the order has an impact on the overall integration
3-
# process, which may cause wedges in the gate later.
1+
# Development environment dependencies
42

5-
py >= 1.4
6-
7-
hacking
8-
9-
pytest
10-
pytest-cov
3+
# Install testing dependencies from setup.py
4+
.[testing]

requirements.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# Package dependencies
2+
13
setuptools
2-
six
4+
5+
# Include package dependencies from setup.py
6+
.

setup.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import sys
88
import warnings
99

10-
from pip.req import parse_requirements
1110
from setuptools import setup, find_packages, Command
1211
from setuptools.command.test import test as TestCommand
1312

@@ -124,23 +123,25 @@ def run(self):
124123
raise RuntimeError(
125124
"Current version of the package is equal or lower than the already published ones (PyPi). Increse version to be able to pass prerelease stage.")
126125

126+
install_requires = [ 'six' ]
127127

128-
def get_requirements(*path):
129-
req_path = os.path.join(*path)
130-
reqs = parse_requirements(req_path, session=False)
131-
return [str(ir.req) for ir in reqs]
132-
128+
# The order of packages is significant, because pip processes them in the order
129+
# of appearance. Changing the order has an impact on the overall integration
130+
# process, which may cause wedges in the gate later.
131+
tests_require = [ 'py >= 1.4', 'hacking', 'pytest', 'pytest-cov' ]
133132

134133
setup(
135134
name=NAME,
136135
version=__version__,
137136
cmdclass={'test': PyTest, 'release': Release, 'prerelease': PreRelease},
138137
packages=find_packages(exclude=['tests']),
139138
include_package_data=True,
140-
tests_require=get_requirements(base_path, 'requirements-dev.txt'),
139+
tests_require=tests_require,
141140
setup_requires=['setuptools'],
142-
install_requires=get_requirements(base_path, 'requirements.txt'),
143-
141+
install_requires=install_requires,
142+
extras_require={
143+
'testing': tests_require
144+
},
144145
license='BSD',
145146
description="WSDL parsing services package for Web Services for Python. see" + url,
146147
long_description=open("README.rst").read(),

0 commit comments

Comments
 (0)