Skip to content

Commit e2d0d01

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

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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():
41+
root = os.path.dirname(os.path.realpath(__file__))
42+
requirements = os.path.join(root, 'requirements.txt')
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(),
7581
python_requires='>=3',
7682
)

0 commit comments

Comments
 (0)