-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
77 lines (61 loc) · 1.95 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
68
69
70
71
72
73
74
75
76
77
from setuptools import setup, find_packages
import versioneer
import distutils.command
import distutils.log
import subprocess
name = 'python_react_pkg'
description = 'Template for a React/Flask based web app in a package format'
version = versioneer.get_version()
sphinx_version = '.'.join(version.split('.')[:2])
cmd_classes = versioneer.get_cmdclass()
class NpmBuild(distutils.cmd.Command):
description = 'build web client'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
command = ['npm', 'run', 'build']
self.announce(
'Running command %s' % str(command),
level=distutils.log.INFO
)
subprocess.check_call(command)
cmd_classes['npm_build'] = NpmBuild
ver_build = cmd_classes['build_py']
class build_py(ver_build):
def run(self):
self.run_command('npm_build')
ver_build.run(self)
cmd_classes['build_py'] = build_py
if __name__ == '__main__':
setup(
name=name,
packages=find_packages(exclude=['tests']),
version=version,
cmdclass=cmd_classes,
description=description,
long_description=open('README.md', 'r').read(),
author='Cameron Phillips',
author_email='[email protected]',
url='https://github.com/camphillips22/python_react_pkg.git',
license=open('LICENSE', 'r').read(),
install_requires=(
'gevent',
'flask',
'Flask-SocketIO',
),
tests_require=(),
include_package_data=True,
zip_safe=False,
command_options={
'build_sphinx': {
'project': ('setup.py', name),
'version': ('setup.py', sphinx_version),
'release': ('setup.py', version),
'source_dir': ('setup.py', 'doc/source'),
'build_dir': ('setup.py', 'doc/build'),
},
},
)