|
15 | 15 | from os import path
|
16 | 16 | from subprocess import PIPE, Popen
|
17 | 17 |
|
18 |
| -here = path.abspath(path.dirname(__file__)) |
| 18 | +__location__ = path.abspath(path.dirname(__file__)) |
19 | 19 |
|
20 | 20 |
|
21 | 21 | def pkgconfig(*packages):
|
@@ -54,8 +54,24 @@ def pkgconfig(*packages):
|
54 | 54 | return config
|
55 | 55 |
|
56 | 56 |
|
| 57 | +def read_requirements(): |
| 58 | + """parses requirements from requirements.txt""" |
| 59 | + reqs_path = path.join(__location__, 'requirements.txt') |
| 60 | + with open(reqs_path, encoding='utf8') as f: |
| 61 | + reqs = [line.strip() for line in f if not line.strip().startswith('#')] |
| 62 | + |
| 63 | + names = [] |
| 64 | + links = [] |
| 65 | + for req in reqs: |
| 66 | + if '://' in req: |
| 67 | + links.append(req) |
| 68 | + else: |
| 69 | + names.append(req) |
| 70 | + return {'install_requires': names, 'dependency_links': links} |
| 71 | + |
| 72 | + |
57 | 73 | # Get the long description from the README file
|
58 |
| -with open(path.join(here, 'README.md'), encoding='utf-8') as f: |
| 74 | +with open(path.join(__location__, 'README.md'), encoding='utf-8') as f: |
59 | 75 | long_description = f.read()
|
60 | 76 |
|
61 | 77 | setup(
|
@@ -120,31 +136,7 @@ def pkgconfig(*packages):
|
120 | 136 | # your project is installed. For an analysis of "install_requires" vs pip's
|
121 | 137 | # requirements files see:
|
122 | 138 | # https://packaging.python.org/en/latest/requirements.html
|
123 |
| - install_requires=[ |
124 |
| - 'wikipedia==1.4.0', |
125 |
| - 'PyUserInput==0.1.11', |
126 |
| - 'tinydb==3.9.0.post1', |
127 |
| - 'youtube_dl', |
128 |
| - 'spacy==2.1.3', |
129 |
| - 'pyowm==2.9.0', |
130 |
| - 'tensorflow==1.15.0', |
131 |
| - 'deepspeech==0.4.1', |
132 |
| - 'requests>=2.20.0', |
133 |
| - 'nltk', |
134 |
| - 'httplib2>=0.9.1', |
135 |
| - 'tweepy==3.7.0', |
136 |
| - 'metadata_parser==0.9.20', |
137 |
| - 'hug==2.4.0', |
138 |
| - 'hug-middleware-cors==1.0.0', |
139 |
| - 'waitress==1.1.0', |
140 |
| - 'SpeechRecognition', |
141 |
| - 'pyjwt==1.6.4', |
142 |
| - 'SQLAlchemy>=1.3.0', |
143 |
| - 'PyMySQL==0.8.1', |
144 |
| - 'msgpack==0.5.6', |
145 |
| - 'neuralcoref==4.0', |
146 |
| - 'deeppavlov==0.7.1' |
147 |
| - ], |
| 139 | + **read_requirements(), |
148 | 140 |
|
149 | 141 | # List additional groups of dependencies here (e.g. development
|
150 | 142 | # dependencies). You can install these using the following syntax,
|
@@ -190,4 +182,5 @@ def pkgconfig(*packages):
|
190 | 182 | ext_modules=[
|
191 | 183 | Extension('realhud', ['dragonfire/realhud/realhud.c'],
|
192 | 184 | **pkgconfig('gtk+-2.0 x11 xext'))
|
193 |
| - ]) |
| 185 | + ] |
| 186 | +) |
0 commit comments