-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
67 lines (54 loc) · 2.06 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
import setuptools.command.build_py
import subprocess
import os
from setuptools import find_packages, setup
class build_ui(setuptools.Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.call(["npm", "install"], cwd="./confusionflow/ui")
subprocess.call(["npm", "run", "build"], cwd="./confusionflow/ui")
subprocess.call(
["cp", "-r", "./confusionflow/ui/build", "./confusionflow/static"]
)
class build_py(setuptools.command.build_py.build_py):
def run(self):
if not os.path.exists("./confusionflow/static"):
self.run_command("build_ui")
setuptools.command.build_py.build_py.run(self)
# get __version__
pkg_info = {}
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, "confusionflow", "_version.py")).read(), pkg_info)
requirements = {"install": [["flask", "gevent", "pyyaml"]]}
install_requires = requirements["install"]
setup_kwargs = dict(
name="confusionflow",
version=pkg_info["__version__"],
author="ConfusionFlow Contributors",
author_email="gfrogat@gmail.com",
url="https://github.com/confusionflow/confusionflow",
license="BSD-3-Clause",
description=(
"ConfusionFlow is a visualization tool that enables more "
"nuanced monitoring of a neural network's training process."
),
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
project_urls={
"Documentation": "https://docs.confusionflow.org",
"Source": "https://github.com/confusionflow/confusionflow/",
"Tracker": "https://github.com/confusionflow/confusionflow/issues",
},
cmdclass={"build_py": build_py, "build_ui": build_ui},
packages=find_packages(),
package_data={"confusionflow": ["static/*.*"]},
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
entry_points={"console_scripts": ["confusionflow=confusionflow:main"]},
)
setup(**setup_kwargs)