Skip to content

Commit e69a103

Browse files
committed
got rid of dynamic requirement parsing in setup.py
1 parent 60a956f commit e69a103

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

setup.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
import os
44
import re
55

6-
try:
7-
from pip.download import PipSession
8-
except ImportError:
9-
from pip._internal.download import PipSession
10-
11-
try:
12-
from pip.req import parse_requirements
13-
except ImportError:
14-
from pip._internal.req import parse_requirements
15-
166
from setuptools import setup, find_packages
177

188

@@ -30,27 +20,6 @@ def find_version(*file_paths):
3020
raise RuntimeError("Unable to find version string.")
3121

3222

33-
def requirements(file_name='requirements.txt'):
34-
return [
35-
str(ir.req)
36-
for ir in parse_requirements(file_name, session=PipSession())
37-
if ir.match_markers()
38-
]
39-
40-
41-
def extra_requirements():
42-
try:
43-
join = os.path.join
44-
path = join('requirements', 'extra')
45-
return {
46-
str(file_name.rsplit('.', 1)[0]): requirements(join(path, file_name))
47-
for file_name in os.listdir(path)
48-
if file_name.endswith('.txt')
49-
}
50-
except OSError:
51-
return None
52-
53-
5423
def get_packages(package):
5524
"""
5625
Return root package and all sub-packages.
@@ -82,7 +51,7 @@ def get_package_data(package):
8251
author='James Lin',
8352
author_email='[email protected]',
8453
long_description='',
85-
install_requires=requirements(),
54+
install_requires=['requests>=2.1'],
8655
packages=find_packages(exclude=["tests", "api", "api.*", "web", "web.*", "django_rest_framework_queryset"]),
8756
# packages=get_packages('rest_framework_queryset'),
8857
# package_data=get_package_data('rest_framework_queryset'),
@@ -96,5 +65,4 @@ def get_package_data(package):
9665
"Programming Language :: Python :: 3.6",
9766
"Framework :: Django",
9867
],
99-
extras_require=extra_requirements(),
10068
)

0 commit comments

Comments
 (0)