This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
/
setup.py
92 lines (72 loc) · 2.83 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
90
91
92
import sys
import os
from setuptools import find_packages, setup
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
def parse_requirements(filepath):
""" load requirements from a pip requirements file. """
with open(filepath) as f:
lines = (line.strip() for line in f)
return [line for line in lines if line and not line.startswith('#')]
def get_zdict_version():
constants_file_path = os.path.join(ROOT_DIR, 'zdict/constants.py')
with open(constants_file_path) as constants:
for line in constants:
if line.startswith('VERSION'):
code = compile(line, '<string>', 'single')
version = code.co_consts[0]
return version
def get_test_req():
test_requirements = parse_requirements(
os.path.join(ROOT_DIR, 'requirements-test.txt')
)
if not sys.platform.startswith('freebsd'):
test_requirements.append('gnureadline==6.3.3')
return test_requirements
version = get_zdict_version()
install_requirements = parse_requirements(
os.path.join(ROOT_DIR, 'requirements.txt')
)
if sys.platform == 'darwin' and sys.version_info <= (3, 5):
install_requirements.append('gnureadline==6.3.3')
setup(
packages=find_packages(exclude=['scripts']),
scripts=['scripts/zdict'],
install_requires=install_requirements,
tests_require=get_test_req(),
name='zdict',
version=version,
author='Frank Zheng',
author_email='github@m157q.tw',
maintainer='Frank Zheng, Iblis Lin, Chang-Yen Chih, Chiu-Hsiang Hsu',
maintainer_email=('github@m157q.tw,'
'e196819@hotmail.com,'
'michael66230@gmail.com,'
'wdv4758h@gmail.com'),
url='https://github.com/zdict/zdict',
keywords="cli, dictionary, framework",
description="The last online dictionary framework you need. (?)",
long_description=open("README.rst", encoding='utf-8').read(),
long_description_content_type="text/x-rst",
download_url="https://github.com/zdict/zdict/archive/v{}.zip".format(
version
),
platforms=['Linux', 'Mac'],
license="GPL3",
python_requires=">=3.7",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: Chinese (Traditional)",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Utilities",
],
)