Skip to content

Commit b75fca4

Browse files
setup: get package requirements from file
Part of #238
1 parent 9fa3ce6 commit b75fca4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: setup.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def read(*parts):
3737
with codecs.open(filename, encoding='utf-8') as fp:
3838
return fp.read()
3939

40+
def get_dependencies(file):
41+
root = os.path.dirname(os.path.realpath(__file__))
42+
requirements = os.path.join(root, file)
43+
result = []
44+
if os.path.isfile(requirements):
45+
with open(requirements) as f:
46+
result = f.read().splitlines()
47+
return result
4048

4149
def find_version(*file_paths):
4250
version_file = read(*file_paths)
@@ -69,8 +77,6 @@ def find_version(*file_paths):
6977
],
7078
cmdclass=cmdclass,
7179
command_options=command_options,
72-
install_requires=[
73-
'msgpack>=1.0.4',
74-
],
80+
install_requires=get_dependencies('requirements.txt'),
7581
python_requires='>=3',
7682
)

0 commit comments

Comments
 (0)