-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (60 loc) · 1.8 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
"""
Flask-ErrorsHandler
-------------------
"""
import os
import re
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test
BASE_PATH = os.path.dirname(__file__)
VERSION_FILE = os.path.join('flask_errors_handler', 'version.py')
def read(file):
with open(os.path.join(BASE_PATH, file)) as f:
return f.read()
def grep(file, name):
strval, = re.findall(fr"{name}\W*=\W*'([^']+)'", read(file))
return strval
def readme(file):
try:
return read(file)
except OSError as exc:
print(str(exc), file=sys.stderr)
class PyTest(test):
def finalize_options(self):
test.finalize_options(self)
def run_tests(self):
import pytest
sys.exit(pytest.main(['tests']))
setup(
name='Flask-ErrorsHandler',
version=grep(VERSION_FILE, '__version__'),
url='https://github.com/cs91chris/flask_errors_handler',
license='MIT',
author=grep(VERSION_FILE, '__author_name__'),
author_email=grep(VERSION_FILE, '__author_email__'),
description='Customizable errors handler for flask application and blueprints',
long_description=readme('README.rst'),
packages=find_packages(),
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=[
'Flask >= 1.0.4',
],
tests_require=[
'pytest >= 5',
'pytest-cov >= 2'
],
cmdclass={'test': PyTest},
test_suite='tests',
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)