forked from 7sDream/zhihu-py3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·68 lines (54 loc) · 1.69 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import ast
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def extract_version():
with open('zhihu/__init__.py', 'rb') as f_version:
ast_tree = re.search(
r'__version__ = (.*)',
f_version.read().decode('utf-8')
).group(1)
if ast_tree is None:
raise RuntimeError('Cannot find version information')
return str(ast.literal_eval(ast_tree))
with open('README.rst', 'rb') as f_readme:
readme = f_readme.read().decode('utf-8')
packages = ['zhihu']
version = extract_version()
setup(
name='zhihu-py3',
version=version,
keywords=['zhihu', 'network', 'spider', 'html'],
description='Zhihu UNOFFICIAL API library in python3, '
'with help of bs4, lxml, requests and html2text.',
long_description=readme,
author='7sDream',
author_email='[email protected]',
license='MIT',
url='https://github.com/7sDream/zhihu-py3',
download_url='https://github.com/7sDream/zhihu-py3',
install_requires=[
'beautifulsoup4',
'requests',
'html2text'
],
extras_require={
'lxml': ['lxml']
},
packages=packages,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)