-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathsetup.py
53 lines (41 loc) · 1.24 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os.path
import re
from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
requirements = []
with open('requirements.txt') as f:
for line in f.readlines():
line.strip()
if line.startswith('#'):
continue
requirements.append(line)
version = None
with open(os.path.join('flask_mdict', '__init__.py')) as f:
text = f.read()
mo = re.search(r"__version__ = '([\d\.]+)'", text)
version = mo.group(1)
def package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
extra_files = package_files('flask_mdict/static')
extra_files += package_files('flask_mdict/templates')
setup(
name='flask_mdict',
version=version,
author='Yugang LIU',
author_email='[email protected]',
url='https://github.com/liuyug/flask-mdict',
license='MIT',
description='Flask Mdict Server',
long_description=long_description,
python_requires='>=3.6',
platforms=['noarch'],
packages=find_packages(),
package_data={'': extra_files},
install_requires=requirements,
zip_safe=False,
)