-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
85 lines (71 loc) · 2.46 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
81
82
83
84
85
import glob
import os
import shutil
import sys
from pathlib import Path
from setuptools import Command, find_packages, setup
README = (Path(__file__).parent / "README.md").read_text(encoding="UTF-8")
HERE = Path(os.path.dirname(__file__)).absolute()
# get __version__ from timeeval/_version.py
with open(Path("autotsad") / "_version.py") as f:
exec(f.read())
VERSION: str = __version__ # noqa
def load_dependencies():
EXCLUDES = ["python", "pip"]
with open(HERE / "requirements.txt", "r", encoding="UTF-8") as f:
env = f.readlines()
def excluded(name):
return any([excl in name for excl in EXCLUDES])
deps = [dep for dep in env if not excluded(dep)]
return deps
class CleanCommand(Command):
description = "Remove build artifacts from the source tree"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
files = [".coverage*", "coverage.xml"]
dirs = [
"build",
"dist",
"*.egg-info",
"**/__pycache__",
".mypy_cache",
".pytest_cache",
"**/.ipynb_checkpoints",
]
for d in dirs:
for filename in glob.glob(d):
shutil.rmtree(filename, ignore_errors=True)
for f in files:
for filename in glob.glob(f):
try:
os.remove(filename)
except OSError:
pass
if __name__ == "__main__":
setup(
name="AutoTSAD",
version=VERSION,
description="Unsupervised Anomaly Detection System for Univariate Time Series",
long_description=README,
long_description_content_type="text/markdown",
author="Sebastian Schmidl",
author_email="[email protected]",
url="https://github.com/HPI-Information-Systems/AutoTSAD",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
packages=find_packages(exclude=("data", "db", "notebooks", "scripts")),
install_requires=load_dependencies(),
python_requires=">=3.8, <3.10",
cmdclass={"clean": CleanCommand},
zip_safe=False,
entry_points={"console_scripts": ["autotsad=autotsad.__main__:cli"]},
)