forked from dahlia/wikidata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
70 lines (63 loc) · 2.36 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
import ast
import os
import os.path
from setuptools import find_packages, setup
def get_version():
module_path = os.path.join(os.path.dirname(__file__),
'wikidata', '__init__.py')
module_file = open(module_path)
try:
module_code = module_file.read()
finally:
module_file.close()
tree = ast.parse(module_code, module_path)
for node in ast.iter_child_nodes(tree):
if not isinstance(node, ast.Assign) or len(node.targets) != 1:
continue
target, = node.targets
if isinstance(target, ast.Name) and target.id == '__version__':
value = node.value
if isinstance(value, ast.Str):
return value.s
raise ValueError('__version__ is not defined as a string literal')
raise ValueError('could not find __version__')
def readme():
path = os.path.join(os.path.dirname(__file__), 'README.rst')
try:
with open(path) as f:
return f.read()
except IOError:
pass
setup(
name='Wikidata',
version=get_version(),
description='Wikidata client library',
long_description=readme(),
url='https://github.com/dahlia/wikidata',
author='Hong Minhee',
author_email='hong.minhee' '@' 'gmail.com',
license='GPLv3 or later',
packages=find_packages(exclude=['docs', 'tests']),
python_requires='>=3.4.0',
install_requires=['Babel >= 2.0'],
extras_require={':python_version<"3.5"': ['typing']},
keywords='wikidata ontology',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', # noqa: E501
'Operating System :: OS Independent',
# CHECK If you're going to change the list of supported Python versions
# update .travis.yml and tox.ini as well.
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Database',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Libraries :: Python Modules',
]
)