- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
77 lines (61 loc) · 1.95 KB
/
Copy pathsetup.py
File metadata and controls
77 lines (61 loc) · 1.95 KB
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
fromsetuptoolsimportsetup, find_packages
importversioneer
importdistutils.command
importdistutils.log
importsubprocess
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()
classNpmBuild(distutils.cmd.Command):
description='build web client'
user_options= []
definitialize_options(self):
pass
deffinalize_options(self):
pass
defrun(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']
classbuild_py(ver_build):
defrun(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='cam.phillips22@gmail.com',
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'),
},
},
)