forked from jfinkels/flask-restless
-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
108 lines (92 loc) · 3.73 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
# setup.py - packaging and distribution configuration for Flask-Restless
#
# Copyright 2011 Lincoln de Sousa <[email protected]>.
# Copyright 2012, 2013, 2014, 2015, 2016 Jeffrey Finkelstein
# <[email protected]> and contributors.
#
# This file is part of Flask-Restless.
#
# Flask-Restless is distributed under both the GNU Affero General Public
# License version 3 and under the 3-clause BSD license. For more
# information, see LICENSE.AGPL and LICENSE.BSD.
"""Flask-Restless-NG is a `Flask`_ extension that provides simple
generation of ReSTful APIs that satisfy the `JSON API`_ specification
given database models defined using `SQLAlchemy`_ (or `Flask-SQLAlchemy`_).
For more information, see the `documentation`_, `pypi`_, or the `source
code`_ repository.
.. _Flask: http://flask.pocoo.org
.. _SQLAlchemy: https://sqlalchemy.org
.. _Flask-SQLAlchemy: https://pypi.python.org/pypi/Flask-SQLAlchemy
.. _JSON API: http://jsonapi.org
.. _documentation: https://flask-restless-ng.readthedocs.org
.. _pypi: https://pypi.python.org/pypi/Flask-Restless-NG
.. _source code: https://github.com/mrevutskyi/flask-restless-ng
"""
import codecs
import os.path
import re
from setuptools import setup
#: A regular expression capturing the version number from Python code.
VERSION_RE = r"^__version__ = ['\"]([^'\"]*)['\"]"
#: The installation requirements Flask-SQLAlchemy is not
#: required, so the user must install it explicitly.
REQUIREMENTS = [
'flask>=2.2,<3.1',
'sqlalchemy>=1.4.18,<2.1',
'python-dateutil>2.2',
'MarkupSafe>=2.0',
]
#: The absolute path to this file.
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
"""Reads the entire contents of the file whose path is given as `parts`."""
with codecs.open(os.path.join(HERE, *parts), 'r') as f:
return f.read()
def find_version(*file_path):
"""Returns the version number appearing in the file in the given file
path.
Each positional argument indicates a member of the path.
"""
version_file = read(*file_path)
version_match = re.search(VERSION_RE, version_file, re.MULTILINE)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')
setup(
author='Maksym Revutskyi',
author_email='[email protected]',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Flask',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
'Topic :: Database :: Front-Ends',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules'
],
description='A fork of Flask-Restless with updated dependencies and bug fixes',
download_url='https://pypi.python.org/pypi/Flask-Restless-NG',
install_requires=REQUIREMENTS,
include_package_data=True,
keywords=['ReST', 'API', 'Flask'],
license='GNU AGPLv3+ or BSD',
long_description=__doc__,
name='Flask-Restless-NG',
platforms='any',
python_requires='>=3.8',
packages=['flask_restless', 'flask_restless.views'],
test_suite='tests',
tests_require=[],
url='https://github.com/mrevutskyi/flask-restless-ng',
version=find_version('flask_restless', '__init__.py'),
zip_safe=False,
)