-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (44 loc) · 1.32 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
import setuptools
import re
with open("README.md") as f:
long_description = f.read()
reqs = set()
for fn in ["requirements.txt", "libsvc/requirements.txt"]:
with open(fn) as f:
s = set( f.read().splitlines() )
reqs = reqs.union(s)
reqs = list(reqs)
with open("diana/__init__.py") as f:
content = f.read()
match = re.findall(r"__([a-z0-9_]+)__\s*=\s*\"([^\"]+)\"", content)
print(match)
metadata = dict(match)
packages = [*setuptools.find_packages(), *setuptools.find_packages(where="libsvc")]
setuptools.setup(
name=metadata.get("name"),
version=metadata.get("version"),
author=metadata.get("author"),
author_email=metadata.get("author_email"),
description=metadata.get("desc"),
long_description=long_description,
long_description_content_type="text/markdown",
url=metadata.get("url"),
packages=packages,
package_dir={
# 'diana': 'diana',
'libsvc': 'libsvc/libsvc'
},
include_package_data=True,
classifiers=[
'Development Status :: 3 - Alpha',
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
license='MIT',
install_requires=reqs,
entry_points='''
[console_scripts]
diana-cli=diana.cli.cli:main
'''
)