-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
87 lines (74 loc) · 2.82 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
86
87
import subprocess
from pathlib import Path
from setuptools import setup
from setuptools.command.build_ext import build_ext
WORKING_DIR = Path(__file__).resolve().parent
STATIC_DIR = WORKING_DIR / "tsview" / "tsview_static"
def compile_elm(edit_kind, src):
"""Compile elm component to JS"""
src = WORKING_DIR / 'elm' / src
out = STATIC_DIR / f'{edit_kind}_elm.js'
cmd = f'elm make --optimize --output {out} {src}'
subprocess.call(cmd, shell=True)
class ElmBuild(build_ext):
"""Build Elm components"""
def run(self):
for edit_kind, src in [
('delete', 'Delete.elm'),
('rename', 'Rename.elm'),
('plot', 'Plot.elm'),
('formula', Path('TsView/Formula/Main.elm')),
('tsinfo', 'Tsinfo.elm'),
('groupinfo', 'Groupinfo.elm'),
('search', 'Search.elm'),
('cache', 'Cache.elm'),
]:
compile_elm(edit_kind, src)
css = STATIC_DIR / 'pygmentize.css'
cmd = f'pygmentize -S default -f html -a .highlight > {css}'
subprocess.call(cmd, shell=True)
super().run()
doc = Path(__file__).parent / 'README.md'
setup(name='tsview',
version='0.16.0',
author='Pythonian',
description=('Plugin to `tshistory` which provides a `view` subcommand '
'to visualize time series from a repository and '
'a flask blueprint'),
long_description=doc.read_text(),
long_description_content_type='text/markdown',
url='https://hg.sr.ht/~pythonian/tsview',
packages=['tsview'],
zip_safe=False,
install_requires=[
'flask < 2.2',
'werkzeug < 2.2',
'flask-caching < 2.1',
'pytest_sa_pg',
'tshistory > 0.15',
'plotly < 6.0',
'dash < 2.7',
'dash-renderer < 2.0',
'tshistory_formula > 0.11'
],
package_data={'tsview': [
'tsview_static/*',
'tsview_templates/*'
]},
entry_points={'tshistory.subcommands': [
'view=tsview.cli:view'
]},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Database',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Version Control',
'Topic :: Scientific/Engineering :: Visualization'
],
cmdclass={'build_ext': ElmBuild}
)