1
|
|
|
#!/usr/bin/env python |
2
|
|
|
from __future__ import with_statement, print_function |
3
|
|
|
|
4
|
|
|
try: |
5
|
|
|
# python setup.py test |
6
|
|
|
import multiprocessing # NOQA |
7
|
|
|
except ImportError: |
8
|
|
|
pass |
9
|
|
|
|
10
|
|
|
import os |
11
|
|
|
import sys |
12
|
|
|
|
13
|
|
|
from setuptools import setup, find_packages |
14
|
|
|
from setuptools.command.test import test as TestCommand |
15
|
|
|
|
16
|
|
|
|
17
|
|
|
class PyTest(TestCommand): |
18
|
|
|
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] |
19
|
|
|
|
20
|
|
|
def initialize_options(self): |
21
|
|
|
TestCommand.initialize_options(self) |
22
|
|
|
self.pytest_args = [] |
23
|
|
|
|
24
|
|
|
def finalize_options(self): |
25
|
|
|
TestCommand.finalize_options(self) |
26
|
|
|
self.test_args = [] |
27
|
|
|
self.test_suite = True |
28
|
|
|
|
29
|
|
|
def run_tests(self): |
30
|
|
|
import pytest |
31
|
|
|
errno = pytest.main(self.pytest_args) |
32
|
|
|
sys.exit(errno) |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
cmdclass = {} |
36
|
|
|
cmdclass['test'] = PyTest |
37
|
|
|
|
38
|
|
|
readme = 'README.md' |
39
|
|
|
if os.path.exists('README.rst'): |
40
|
|
|
readme = 'README.rst' |
41
|
|
|
with open(readme, 'rb') as f: |
42
|
|
|
long_description = f.read().decode('utf-8') |
43
|
|
|
|
44
|
|
|
with open('requirements.txt') as f: |
45
|
|
|
requirements = [l for l in f.read().splitlines() if l] |
46
|
|
|
|
47
|
|
|
setup( |
48
|
|
|
name='wechatpy', |
49
|
|
|
version='1.4.2', |
50
|
|
|
author='messense', |
51
|
|
|
author_email='[email protected]', |
52
|
|
|
url='https://github.com/messense/wechatpy', |
53
|
|
|
packages=find_packages(), |
54
|
|
|
keywords='WeChat, wexin, SDK', |
55
|
|
|
description='wechatpy: WeChat SDK for Python', |
56
|
|
|
long_description=long_description, |
57
|
|
|
install_requires=requirements, |
58
|
|
|
include_package_data=True, |
59
|
|
|
tests_require=[ |
60
|
|
|
'pytest', |
61
|
|
|
'httmock', |
62
|
|
|
'redis', |
63
|
|
|
'pymemcache', |
64
|
|
|
'shove', |
65
|
|
|
], |
66
|
|
|
cmdclass=cmdclass, |
67
|
|
|
classifiers=[ |
68
|
|
|
'Development Status :: 5 - Production/Stable', |
69
|
|
|
'License :: OSI Approved :: MIT License', |
70
|
|
|
'Operating System :: MacOS', |
71
|
|
|
'Operating System :: POSIX', |
72
|
|
|
'Operating System :: POSIX :: Linux', |
73
|
|
|
'Programming Language :: Python', |
74
|
|
|
'Programming Language :: Python :: 2.7', |
75
|
|
|
'Programming Language :: Python :: 3.4', |
76
|
|
|
'Programming Language :: Python :: 3.5', |
77
|
|
|
'Programming Language :: Python :: 3.6', |
78
|
|
|
'Programming Language :: Python :: Implementation :: CPython', |
79
|
|
|
'Programming Language :: Python :: Implementation :: PyPy', |
80
|
|
|
'Intended Audience :: Developers', |
81
|
|
|
'Topic :: Software Development :: Libraries', |
82
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules', |
83
|
|
|
'Topic :: Utilities', |
84
|
|
|
], |
85
|
|
|
extras_require={ |
86
|
|
|
'cryptography': ['cryptography'], |
87
|
|
|
'pycrypto': ['pycrypto'], |
88
|
|
|
} |
89
|
|
|
) |
90
|
|
|
|