-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
80 lines (66 loc) · 2.02 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from setuptools import setup, find_packages
import os
readme_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md")
with open(readme_file, "r") as f:
readme = f.read()
ISRELEASED = True
MAJOR = 1
MINOR = 0
MICRO = 1
VERSION = f"{MAJOR}.{MINOR}.{MICRO}"
setup_dir = os.path.abspath(os.path.dirname(__file__))
VFNAME = "treegrad/version.py"
def write_version_py(filename=os.path.join(setup_dir, VFNAME)):
"""
Generate the version.py file automatically upon install only
"""
version = VERSION
if not ISRELEASED:
version += ".dev"
a = open(filename, "w")
file_content = "\n".join(
[
"",
"# THIS FILE IS GENERATED FROM SETUP.PY",
"version = '%(version)s'",
"isrelease = '%(isrelease)s'",
]
)
a.write(file_content % {"version": VERSION, "isrelease": str(ISRELEASED)})
a.close()
write_version_py()
NAME = "treegrad"
DESCRIPTION = "transfer parameters from lightgbm to differentiable decision trees!"
AUTHOR = "Chapman Siu"
install_requires = ["autograd", "sklearn", "lightgbm"]
extras_require = {
"development": [
"sphinx>=1.6.6",
"sphinxcontrib-napoleon>=0.6.1",
"pandoc>=1.0.2",
"nbsphinx>=0.3.3",
"nose2>=0.7.4",
"nose2_html_report>=0.6.0",
"coverage>=4.5.1",
"awscli>=1.15.26",
"flake8>=3.5.0",
"m2r",
]
}
extras_require["complete"] = sorted(set(sum(extras_require.values(), [])))
setup(
url="http://github.com/chappers/TreeGrad",
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=readme,
long_description_content_type="text/markdown",
author=AUTHOR,
author_email="[email protected]",
include_package_data=True,
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
install_requires=install_requires,
extras_require=extras_require,
python_requires=">=3.5", # supporting type hints
zip_safe=False, # force install as source
)