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