forked from repleo/bounca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
67 lines (53 loc) · 1.4 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
from setuptools import Command, find_packages, setup
from setuptools.command.install import install as _install
from setuptools.command.sdist import sdist as _sdist
from typing import List
src_dir = '.'
packages = find_packages(src_dir)
class FrontendBuilder(Command):
user_options = [] # type: List[str]
description = 'builds the frontend assets using NPM'
def run(self):
self.spawn(['npm', 'install'])
def initialize_options(self):
pass
def finalize_options(self):
pass
class sdist(_sdist):
def run(self):
"""
Runs the frontend command *before* packaging everything.
"""
self.run_command('frontend')
_sdist.run(self)
class install(_install):
def run(self):
"""
Runs the frontend command *after* installing the python package(s).
"""
_install.run(self)
self.run_command('frontend')
cmdclass = {
'sdist': sdist,
'install': install,
'frontend': FrontendBuilder,
}
setup(
name='bounca',
version='1.0',
cmdclass=cmdclass,
entry_points={
'console_scripts': [
'djadmin = manage:main'
]
},
scripts=['manage.py'],
packages=packages,
include_package_data=True,
license='proprietary',
classifiers=[
'Private :: Do Not Upload',
'License :: Other/Proprietary License',
],
zip_safe=False,
)