-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathsetup.py
63 lines (49 loc) · 1.36 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
from typing import List
from setuptools import Command, find_packages, setup
from setuptools.command.install import install as _install
from setuptools.command.sdist import sdist as _sdist
src_dir = "."
packages = find_packages(src_dir)
class FrontendBuilder(Command):
user_options: 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="0.4.5",
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,
)