-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (67 loc) · 2.15 KB
/
setup.py
File metadata and controls
79 lines (67 loc) · 2.15 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
78
79
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from codecs import open
import re
import sys
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
requirements = [
'requests>=2.9.0',
'beautifulsoup4',
'html5lib',
'requests-oauthlib',
]
packages = [
'shanbay',
]
current_dir = os.path.dirname(os.path.realpath(__file__))
def read_f(name):
with open(os.path.join(current_dir, name), encoding='utf8') as f:
return f.read()
def long_description():
return read_f('README.rst') + '\n\n' + read_f('CHANGELOG.rst')
def meta_info(meta, filename='shanbay/__init__.py', default=''):
meta = re.escape(meta)
m = re.search(r"""%s\s+=\s+(?P<quote>['"])(?P<meta>.+?)(?P=quote)"""
% meta, read_f(filename))
return m.group('meta') if m else default
setup(
name='shanbay',
version=meta_info('__version__'),
description='Python wrapper for shanbay.com',
long_description=long_description(),
url='https://github.com/mozillazg/python-shanbay',
download_url='',
author=meta_info('__author__'),
author_email=meta_info('__email__'),
license=meta_info('__license__'),
packages=packages,
package_data={'': ['LICENSE']},
package_dir={'shanbay': 'shanbay'},
include_package_data=True,
install_requires=requirements,
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Utilities',
],
keywords='shanbay, 扇贝网',
)