Skip to content

Commit e057f27

Browse files
authored
Merge pull request kubernetes-client#509 from asottile/only_ipaddress_python_2
Only depend on ipaddress in python2
2 parents 22e8cb4 + 904f871 commit e057f27

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ setuptools>=21.0.0 # PSF/ZPL
55
urllib3>=1.19.1,!=1.21 # MIT
66
pyyaml>=3.12 # MIT
77
google-auth>=1.0.1 # Apache-2.0
8-
ipaddress>=1.0.17 # PSF
8+
ipaddress>=1.0.17;python_version=="2.7" # PSF
99
websocket-client>=0.32.0,!=0.40.0,!=0.41.*,!=0.42.* # LGPLv2+
1010
requests # Apache-2.0
1111
requests-oauthlib # ISC

setup.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from setuptools import find_packages, setup
15+
from setuptools import setup
1616

1717
# Do not edit these constants. They will be updated automatically
1818
# by scripts/update-client.sh.
@@ -27,8 +27,18 @@
2727
# prerequisite: setuptools
2828
# http://pypi.python.org/pypi/setuptools
2929

30+
EXTRAS = {}
31+
REQUIRES = []
3032
with open('requirements.txt') as f:
31-
REQUIRES = f.readlines()
33+
for line in f:
34+
line, _, _ = line.partition('#')
35+
line = line.strip()
36+
if ';' in line:
37+
requirement, _, specifier = line.partition(';')
38+
for_specifier = EXTRAS.setdefault(':{}'.format(specifier), [])
39+
for_specifier.append(requirement)
40+
else:
41+
REQUIRES.append(line)
3242

3343
with open('test-requirements.txt') as f:
3444
TESTS_REQUIRES = f.readlines()
@@ -44,6 +54,7 @@
4454
keywords=["Swagger", "OpenAPI", "Kubernetes"],
4555
install_requires=REQUIRES,
4656
tests_require=TESTS_REQUIRES,
57+
extras_require=EXTRAS,
4758
packages=['kubernetes', 'kubernetes.client', 'kubernetes.config',
4859
'kubernetes.watch', 'kubernetes.client.apis',
4960
'kubernetes.stream', 'kubernetes.client.models'],

0 commit comments

Comments
 (0)