-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
75 lines (60 loc) · 1.98 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
import glob
import os
import os.path as path
import shutil
from setuptools import Command, setup
here = path.abspath(path.dirname(__file__))
SUNGEAR_STATIC_PATH = path.join(here, "sungear", "static")
class Webpack(Command):
description = "build web assets"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
subprocess.run(
["npm", "install"], cwd=path.join(here, "sungear_react"), check=True
)
subprocess.run(
["npm", "run", "build"], cwd=path.join(here, "sungear_react"), check=True
)
os.makedirs(SUNGEAR_STATIC_PATH, exist_ok=True)
for p in glob.glob(os.path.join(SUNGEAR_STATIC_PATH, "*")):
os.remove(p)
for p in glob.glob(os.path.join(here, "sungear_react", "dist", "*")):
if p.endswith("report.html"):
continue
shutil.copy(p, SUNGEAR_STATIC_PATH)
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="sungear",
version="1.2.0",
description="Web based Sungear visualization.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Zachary Juang",
author_email="[email protected]",
url="https://github.com/zachary822/sungear",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
],
packages=["sungear"],
package_data={"sungear": ["static/*"], "": ["LICENSE"]},
python_requires=">=3.6",
install_requires=[
"numpy",
"pandas",
"scikit-learn",
"scipy",
"statsmodels",
],
extras_require={"web": ["flask"]},
tests_require=["pytest"],
project_urls={"Bug Reports": "https://github.com/zachary822/sungear/issues"},
cmdclass={"webpack": Webpack},
)