Skip to content

Commit 107c035

Browse files
authored
Merge pull request #100 from cloudblue/pip-v20-fix
Removed pip dependencies
2 parents 69edfe3 + 646e222 commit 107c035

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ matrix:
2020
sudo: true
2121

2222
install:
23-
- pip install --upgrade pip==19.1
2423
- pip install -r requirements/test.txt
2524
- pip install -r requirements/sdk.txt
2625
- pip install pytest-cov

requirements/sdk.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ marshmallow==2.18.0
33
openpyxl==2.5.14
44
requests==2.21.0
55
six==1.12.0
6+
pathlib==1.0.1
67

setup.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,16 @@
77
from os.path import abspath, dirname, exists, join
88
from setuptools import find_packages, setup
99

10-
try:
11-
# pip >=20
12-
from pip._internal.network.session import PipSession
13-
from pip._internal.req import parse_requirements
14-
except ImportError:
15-
try:
16-
# 10.0.0 <= pip <= 19.3.1
17-
from pip._internal.download import PipSession
18-
from pip._internal.req import parse_requirements
19-
except ImportError:
20-
# pip <= 9.0.3
21-
from pip.download import PipSession
22-
from pip.req import parse_requirements
10+
import pathlib
11+
import pkg_resources
2312

2413
# noinspection PyTypeChecker
25-
install_reqs = parse_requirements(
26-
join(
27-
dirname(abspath(__file__)),
28-
'requirements',
29-
'sdk.txt',
30-
), session='None')
14+
with pathlib.Path('requirements/sdk.txt').open() as requirements_txt:
15+
install_reqs = [
16+
str(requirement)
17+
for requirement
18+
in pkg_resources.parse_requirements(requirements_txt)
19+
]
3120

3221
PACKAGES = find_packages(exclude=['tests*'])
3322

@@ -47,7 +36,7 @@
4736
url='https://github.com/ingrammicro/connect-python-sdk',
4837
license='Apache Software License',
4938
include_package_data=True,
50-
install_requires=[str(ir.req) for ir in install_reqs],
39+
install_requires=install_reqs,
5140

5241
classifiers=[
5342
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)