-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
46 lines (39 loc) · 1.23 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
import distutils
import os
import subprocess
import setuptools
from setuptools.command.develop import develop
from setuptools.command.install import install
def build_js():
subprocess.check_call(["yarn", "install"], cwd=os.path.join(os.getcwd(), "frontend"))
subprocess.check_call(["yarn", "build"], cwd=os.path.join(os.getcwd(), "frontend"))
# Build JS code when this package is installed in virtual env
# https://stackoverflow.com/a/36902139
class BuildJSDevelopCommand(develop):
def run(self):
self.announce("Building JS code", level=distutils.log.INFO)
build_js()
super().run()
class BuildJSInstallCommand(install):
def run(self):
self.announce("Building JS code", level=distutils.log.INFO)
build_js()
super().run()
setuptools.setup(
name="geogateway-django-app",
version="0.0.1",
description="GeoGateway Django app",
packages=setuptools.find_packages(),
include_package_data=True,
install_requires=[
'django>=1.11.16'
],
entry_points="""
[airavata.djangoapp]
geogateway_django_app = geogateway_django_app.apps:GeogatewayDjangoAppConfig
""",
cmdclass={
'develop': BuildJSDevelopCommand,
'install': BuildJSInstallCommand,
}
)