-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (45 loc) · 1.47 KB
/
setup.py
File metadata and controls
57 lines (45 loc) · 1.47 KB
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
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from subprocess import check_call
from os import path
from distutils import log
def install_highcharts():
try:
check_call("./install-highcharts-export-server.sh", cwd=path.realpath("server/analytics/scripts"))
except Exception as e:
log.error(f"\t**NodeJs not found, report scheduling will not work**:\n\t{e}")
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
self.execute(install_highcharts, ())
develop.run(self)
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
self.execute(install_highcharts, ())
install.run(self)
package_data = {
"analytics": ["scripts/*.sh"],
}
setup(
name="superdesk-analytics",
version="3.2.0-dev.0",
package_dir={"": "server"},
packages=find_packages("server"),
package_data=package_data,
include_package_data=True,
author="Sourcefabric",
author_email="contact@sourcefabric.org",
license="MIT",
url="https://github.com/superdesk/superdesk-analytics",
cmdclass={
"develop": PostDevelopCommand,
"install": PostInstallCommand,
},
entry_points={
"console_scripts": [
"install-highcharts-server=analytics.install_highcharts:install_highcharts_server",
],
},
)