-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
109 lines (100 loc) · 3.29 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import glob
import sys
from os import chdir, environ, mkdir, path, system
from shutil import copyfile, rmtree
from setuptools import Command, find_packages, setup
from setuptools.command.test import test as TestCommand
README = path.abspath(path.join(path.dirname(__file__), 'README.md'))
classifiers = [
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Environment :: Web Environment',
'Development Status :: 3 - Alpha',
]
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['skygear']
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
class Doc(Command):
"""Sphinx Document Generation Command"""
description = 'run sphinx-apidoc'
user_options = []
def finalize_options(self):
pass
def initialize_options(self):
pass
def run(self):
metadata = self.distribution.metadata
temp_dir = 'rst'
chdir('docs')
if path.exists(temp_dir) and path.isdir(temp_dir):
rmtree(temp_dir)
mkdir(temp_dir)
environ['SPHINX_APIDOC_OPTIONS'] = 'members'
system('sphinx-apidoc %s -H %s -A %s -V %s -R %s -o %s %s' %
(path.join('..', 'skygear'),
metadata.name,
metadata.author,
metadata.version,
metadata.version,
temp_dir,
path.join('..', 'skygear')))
for f in glob.glob(r'*.rst') + ['conf.py']:
print(f)
copyfile(f, path.join(temp_dir, f))
system('sphinx-build %s %s' % (temp_dir, '_build'))
rmtree(temp_dir)
extras_require={
'zmq': ['pyzmq>=14.7'],
'doc': ['Sphinx==1.6.7',
'sphinx-rtd-theme>=0.2.4',
'sphinxcontrib-napoleon>=0.6.1',
'sphinxcontrib-websupport>=1.0.1']
}
setup(
name='skygear',
version='1.6.1',
packages=find_packages(),
description='Python plugin runtime for Skygear',
long_description=open(README).read(),
classifiers=classifiers,
author='Rick Mak',
author_email='[email protected]',
url='https://github.com/SkygearIO/py-skygear',
license='Apache License, Version 2.0',
install_requires=[
'psycopg2>=2.6.1',
'SQLAlchemy>=1.0.8',
'strict-rfc3339>=0.5',
'requests>=2.20.0',
'websocket-client>=0.32.0',
'bcrypt==3.1.4',
'ConfigArgParse>=0.12.0',
'werkzeug>=0.11.0',
'boto3>=1.4',
'python-json-logger>=0.1.8',
],
extras_require=extras_require,
cmdclass= {'test': PyTest, 'doc': Doc},
tests_require=[
'pytest',
] + extras_require['zmq']
+ extras_require['doc'],
entry_points={
'console_scripts': [
'py-skygear = skygear.bin:main'
]
},
)