-
Notifications
You must be signed in to change notification settings - Fork 43
/
setup.py
89 lines (77 loc) · 2.7 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env python
from __future__ import absolute_import, unicode_literals
import sys
import codecs
try:
from setuptools import setup, Command
extra = dict(include_package_data=True)
except:
from distutils.core import setup, Command
extra = dict()
from hanziconv import __version__, __author__
_classifiers = '''
Development Status :: 4 - Beta
Environment :: Console
Environment :: Web Environment
Intended Audience :: End Users/Desktop
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Natural Language :: Chinese (Simplified)
Natural Language :: Chinese (Traditional)
Operating System :: OS Independent
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: POSIX
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.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: System
Topic :: Text Processing
Topic :: Utilities
'''
_classifiers = [s.strip() for s in _classifiers.splitlines() if s.strip()]
filename = 'README.rst'
encoding = 'utf-8'
if sys.version >= '3':
with open(filename, 'r', encoding=encoding) as fh:
docstring = fh.read()
packages = ['hanziconv']
else:
with open(filename, 'rU') as fh:
fh = codecs.getreader(encoding)(fh)
docstring = fh.read()
packages = [b'hanziconv']
class PyTest(Command):
"""This class implement `python setup.py test` support for pytest"""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)
setup(name='hanziconv',
version=__version__,
description='Hanzi Converter for Traditional and Simplified Chinese',
long_description=docstring,
author=__author__,
author_email='hanzi.converter@gmail.com',
url='https://github.com/berniey/hanziconv',
packages=packages,
scripts=['hanzi-convert', ],
cmdclass=dict(test=PyTest),
classifiers=_classifiers,
license='Apache 2.0',
**extra)