-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
53 lines (43 loc) · 1.32 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
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/scripts')
)
except Exception as e:
log.error('\t**NodeJs not found, report scheduling will not work**:\n\t{}'.format(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 = {
"scripts": ["*.sh"],
}
setup(
name="superdesk-analytics",
version="2.8.0",
package_dir={'': 'server'},
packages=find_packages('server'),
package_data=package_data,
include_package_data=True,
author='Sourcefabric',
author_email='[email protected]',
license='MIT',
url='https://github.com/superdesk/superdesk-analytics',
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand
}
)