-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
68 lines (57 loc) · 1.93 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
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist
VERSION = '0.0.1'
with open('README.md', 'r') as f:
long_description = f.read()
dependencies = [
'apscheduler >= 3.0.0',
'flask >= 1.0.0',
'flask_socketio >= 4.0.0'
]
class SdistWithWebpack(sdist):
"""
We need to extend the sdist command to run webpack in production mode before building the package for distribution.
"""
def run(self):
import os
import subprocess
if 'CI' not in os.environ:
if not os.path.exists('frontend/node_build_env'):
subprocess.check_call(['nodeenv', 'node_build_env'], cwd='frontend')
subprocess.check_call(
['./node_build_env/bin/activate && npm install && npx webpack -p'],
shell=True,
cwd='frontend'
)
sdist.run(self)
setup(
name='apschedulerui',
version=VERSION,
description='',
long_description=long_description,
long_description_content_type='text/markdown',
author='Federico Schmidt',
author_email='[email protected]',
url='https://github.com/schmidtfederico/apscheduler-ui',
packages=find_packages(exclude=['tests']),
install_requires=dependencies,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
"Programming Language :: Python :: 3.5",
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Operating System :: OS Independent',
'Topic :: Internet'
],
python_requires='>=3.5, <4',
extras_require={
'testing': ['requests'],
'testing:python_version == "3.5"': ['mock']
},
cmdclass={'sdist': SdistWithWebpack},
include_package_data=True
)