-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
73 lines (61 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from configparser import ConfigParser
from distutils.util import convert_path
from os import path
import setuptools
main_ns = {}
with open(convert_path("explabox/_version.py")) as ver_file:
exec(ver_file.read(), main_ns) # nosec
with open(path.join(path.abspath(path.dirname(__file__)), "README.md"), encoding="utf-8") as f:
long_description = f.read()
with open(
path.join(path.abspath(path.dirname(__file__)), "requirements.txt"),
encoding="utf-8",
) as f:
requirements = f.read().splitlines()
cfg = ConfigParser()
cfg.read(path.join(path.abspath(path.dirname(__file__)), "tox.ini"))
def get_tox_reqs(keys):
"""Get requirements from `tox.ini`."""
if isinstance(keys, str):
keys = [keys]
deps = []
for key in keys:
deps.extend(cfg.get(key, "deps").strip("\n").split("\n"))
return list(set(deps))
extras = {}
extras["docs"] = [
"m2r>=0.2.1",
"sphinx>=4.1.1",
"sphinx-autodoc-typehints>=1.17.0",
"sphinxcontrib-apidoc>=0.3.0",
] + get_tox_reqs("testenv:doc8")
extras["quality"] = get_tox_reqs(
["testenv:black", "testenv:check-manifest", "testenv:doc8", "testenv:flake8", "testenv:isort"]
)
extras["test"] = get_tox_reqs("testenv")
extras["dev"] = list(set(extras["docs"] + extras["quality"] + extras["test"])) + ["make-to-batch>=0.2.3"]
extras["all"] = list(set([i for subi in extras.values() for i in subi]))
setuptools.setup( # type: ignore
name="explabox",
version=main_ns["__version__"],
description="Explore/examine/explain/expose your model with the explabox!",
long_description=long_description,
long_description_content_type="text/markdown",
author="NPAI",
license="GNU LGPL v3",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
url="https://explabox.rtfd.io",
packages=setuptools.find_packages(exclude=["test*.py"]), # type : ignore
install_requires=requirements,
extras_require=extras,
python_requires=">=3.8",
)