-
Notifications
You must be signed in to change notification settings - Fork 74
/
setup.py
126 lines (109 loc) · 4.23 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# <sure - sophisticated automated test library and runner>
# Copyright (C) <2010-2024> Gabriel Falcão <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""sophisticated automated test library and runner"""
import os
import ast
import sys
import codecs
from setuptools import setup, find_packages
# These python versions are explicitly not supported
# by sure. This is mostly because of the incompatiblities
# with unicode strings. If there is an urgent reason why
# to support it after all or if you have a quick fix
# please open an issue on GitHub.
EXPL_NOT_SUPPORTED_VERSIONS = ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4))
if sys.version_info[0:2] in EXPL_NOT_SUPPORTED_VERSIONS:
raise SystemExit(
"Sure does explicitly not support the following python versions "
"due to big incompatibilities: {0}".format(EXPL_NOT_SUPPORTED_VERSIONS)
)
if sys.version_info[0] < 3:
raise SystemExit(
"Sure no longer supports Python 2"
)
PROJECT_ROOT = os.path.dirname(__file__)
def read_version():
mod = ast.parse(local_text_file("sure", "version.py"))
exp = mod.body[0]
tgt = exp.targets[0]
cst = exp.value
assert tgt.id == "version"
return cst.value
def local_text_file(*f):
path = os.path.join(PROJECT_ROOT, *f)
with open(path, "rt") as fp:
file_data = fp.read()
return file_data
def read_readme():
"""Read README content.
If the README.rst file does not exist yet
(this is the case when not releasing)
only the short description is returned.
"""
try:
return local_text_file("README.rst")
except IOError:
return __doc__
install_requires = ["coverage==7.4.0", "click==8.1.7", "couleur==0.7.4"]
tests_require = ["mock"]
version = read_version()
packages = find_packages(exclude=["*tests*", "*examples*"])
if __name__ == "__main__":
setup(
name="sure",
version=version,
description=__doc__,
long_description=read_readme(),
url="http://github.com/gabrielfalcao/sure",
author="Gabriel Falcao",
author_email="[email protected]",
maintainer="Gabriel Falcao",
maintainer_email="[email protected]",
include_package_data=True,
packages=packages,
install_requires=install_requires,
long_description_content_type='text/x-rst',
entry_points={
"console_scripts": ["sure = sure.cli:entrypoint"],
},
extras_require={
"mock": tests_require,
},
tests_require=tests_require,
classifiers=[
"Development Status :: 1 - Planning",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Testing",
],
)