-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
90 lines (73 loc) · 2.51 KB
/
setup.py
File metadata and controls
90 lines (73 loc) · 2.51 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
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python3
import pathlib
import re
import sys
from setuptools import find_packages, setup
BASE_DIR = pathlib.Path(__file__).parent
README_PATH = BASE_DIR / 'README.rst'
PACKAGE_PATH = BASE_DIR / 'freedictionaryapi'
PACKAGE_INIT_PATH = PACKAGE_PATH / '__init__.py'
MINIMAL_PYTHON_VERSION = (3, 6)
if sys.version_info < MINIMAL_PYTHON_VERSION:
raise RuntimeError(
'freedictionaryapi works only with Python {}+'.format(
'.'.join(map(str, MINIMAL_PYTHON_VERSION))
)
)
def get_version() -> str:
"""
Get version of the `freedictionaryapi` package.
:return: version of the `freedictionaryapi` package
:rtype: str
"""
with open(PACKAGE_INIT_PATH, 'r', encoding='utf-8') as file:
init_file_content = file.read()
try:
return re.findall(r"^__version__ = '([^']+)'\r?$", init_file_content, re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')
def get_long_description() -> str:
"""
Get full description from `README.rst`.
:return: full description from `README.rst`
:rtype: str
"""
with open(README_PATH, 'r', encoding='utf-8') as file:
long_description = file.read()
return long_description
setup(
name='python-freeDictionaryAPI',
version=get_version(),
packages=find_packages(exclude=('tests', 'examples', 'docs', 'Pipfile', 'Pipfile.lock')),
url='https://github.com/Max-Zhenzhera/python-freeDictionaryAPI',
license='MIT',
author='Max Zhenzhera',
requires_python='>=3.6',
author_email='maxzhenzhera@gmail.com',
description='Wrapper for Free Dictionary API https://dictionaryapi.dev/',
long_description=get_long_description(),
classifiers=[
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
install_requires=[
],
extras_require={
'async-client': [
'aiohttp>=3.7.4.post0',
],
'sync-client': [
'httpx>=0.18.1',
],
},
project_urls={
'Documentation': 'https://python-freedictionaryapi.readthedocs.io/',
'Source': 'https://github.com/Max-Zhenzhera/python-freeDictionaryAPI',
'Bug Tracker': 'https://github.com/Max-Zhenzhera/python-freeDictionaryAPI/issues',
},
)