-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
62 lines (51 loc) · 1.81 KB
/
setup.py
File metadata and controls
62 lines (51 loc) · 1.81 KB
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
54
55
56
57
58
59
60
61
62
#!/usr/bin/env3 python3
# Copyright (c) School of Artificial Intelligence, OPtics and ElectroNics(iOPEN), Northwestern PolyTechnical University. All rights reserved.
# Author: Hongjun An (Coder.AN)
# Email: an.hongjun@foxmail.com
import re
import setuptools
def get_package_dir():
pkg_dir = {
"streaknet.tools": "tools",
"streaknet.scripts": "scripts"
}
return pkg_dir
def get_install_requirements():
with open("requirements.txt", "r", encoding="utf-8") as f:
reqs = [x.strip() for x in f.read().splitlines()]
reqs = [x for x in reqs if not x.startswith("#")]
return reqs
def get_streaknet_version():
with open("streaknet/__init__.py", "r") as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
f.read(), re.MULTILINE
).group(1)
return version
def get_long_description():
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
return long_description
setuptools.setup(
name="streaknet",
version=get_streaknet_version(),
author="Coder.AN",
url="",
package_dir=get_package_dir(),
packages=setuptools.find_packages(exclude=("tools", "scripts")) + list(get_package_dir().keys()),
python_requires=">=3.6",
install_requires=get_install_requirements(),
setup_requires=["wheel"], # avoid building error when pip is not updated
long_description=get_long_description(),
long_description_content_type="text/markdown",
include_package_data=True, # include files in MANIFEST.in
classifiers=[
"Programming Language :: Python :: 3", "Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
],
project_urls={
"Documentation": "",
"Source": "",
"Tracker": "",
},
)