forked from pallets-eco/flask-jwt
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
88 lines (74 loc) · 2.34 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
"""
Flask-JWT
=========
Flask-JWT is a Flask extension that adds basic Json Web Token features to any
application.
Resources
---------
* `Documentation <http://packages.python.org/Flask-JWT/>`_
* `Issue Tracker <https://github.com/mattupstate/flask-jwt/issues>`_
* `Source <https://github.com/mattupstate/flask-jwt>`_
* `Development Version
<https://github.com/mattupstate/flask-jwt/raw/develop#egg=Flask-JWT-dev>`_
"""
import ast
import sys
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
_version_re = re.compile(r'__version__\s+=\s+(.*)')
PROJECT = 'flask_jwt'
with open(PROJECT + '/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
def get_requirements(suffix=''):
with open('requirements%s.txt' % suffix) as f:
rv = f.read().splitlines()
return rv
def get_long_description():
with open('README.rst') as f:
rv = f.read()
return rv
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'-xrs',
'--cov', 'flask_jwt',
'--cov-report', 'term-missing',
'--pep8',
'--flakes',
'tests'
]
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name='webstack-flask-jwt',
version=version,
url='https://github.com/webstack/flask-jwt',
license='MIT',
author='Matt Wright',
author_email='[email protected]',
description='JWT token authentication for Flask apps',
long_description=__doc__,
packages=find_packages(),
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=get_requirements(),
tests_require=get_requirements('-dev'),
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)