-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
122 lines (98 loc) · 3.61 KB
/
setup.py
File metadata and controls
122 lines (98 loc) · 3.61 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
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
#!/usr/bin/env python3
import inspect
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
__location__ = os.path.join(os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe())))
def read_version(package):
with open(os.path.join(package, "__init__.py")) as fd:
for line in fd:
if line.startswith("__version__ = "):
return line.split()[-1].strip().strip("'")
version = read_version("firetail")
install_requires = [
"clickclick>=1.2,<21",
"jsonschema>=4.0.1,<5",
"PyYAML>=6.0.1,<7",
"PyJWT>=2.4.0",
"requests>=2.31,<3",
"inflection>=0.3.1,<0.6",
"werkzeug>=3.0.1",
"starlette>=0.27,<1",
]
swagger_ui_require = "swagger-ui-bundle>=0.0.2,<0.1"
flask_require = [
"flask[async]>=2.3.0,<3.0",
"a2wsgi>=1.4,<2",
]
aiohttp_require = [
"aiohttp>=2.3.10,<4",
"aiohttp-jinja2>=0.14.0,<2",
"MarkupSafe>=0.23",
]
tests_require = ["pytest>=6,<7", "pytest-cov>=2,<3", "testfixtures>=6,<7", *flask_require, swagger_ui_require]
tests_require.extend(aiohttp_require)
tests_require.append("pytest-aiohttp")
tests_require.append("aiohttp-remotes")
docs_require = ["sphinx-autoapi==1.8.1"]
class PyTest(TestCommand):
user_options = [("cov-html=", None, "Generate junit html report")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.cov = None
self.pytest_args = ["--cov", "firetail", "--cov-report", "term-missing", "-v"]
self.cov_html = False
def finalize_options(self):
TestCommand.finalize_options(self)
if self.cov_html:
self.pytest_args.extend(["--cov-report", "html"])
self.pytest_args.extend(["tests"])
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
def readme():
try:
return open("README.rst", encoding="utf-8").read()
except TypeError:
return open("README.rst").read()
setup(
name="firetail",
packages=find_packages(),
version=version,
description="Firetail - API first applications with OpenAPI/Swagger and Flask",
long_description=readme(),
# long_description_content_type="text/x-rst",
author="FireTail International (TM)",
url="https://github.com/FireTail-io/firetail-py-lib",
keywords="openapi oai swagger rest api oauth flask microservice framework",
license="LGPLv3",
# setup_requires=['flake8'],
python_requires=">=3.6",
install_requires=install_requires + flask_require,
tests_require=tests_require,
extras_require={
"tests": tests_require,
"flask": flask_require,
"swagger-ui": swagger_ui_require,
"docs": docs_require,
},
cmdclass={"test": PyTest},
test_suite="tests",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
# needed to include swagger-ui (see MANIFEST.in)
include_package_data=True,
entry_points={"console_scripts": ["Firetail = Firetail.cli:main"]},
)