lcdp-flask-utils 1.5.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lcdp-flask-utils
|
|
3
|
+
Version: 1.5.8
|
|
4
|
+
Summary: Flask Utils
|
|
5
|
+
Author: Le Comptoir Des Pharmacies
|
|
6
|
+
Author-email: webmaster@lecomptoirdespharmacies.fr
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Dist: a2wsgi (==1.10.7)
|
|
17
|
+
Requires-Dist: connexion[uvicorn] (==3.1.0)
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from connexion.apps.flask import FlaskApp
|
|
2
|
+
from connexion.spec import Specification
|
|
3
|
+
|
|
4
|
+
# Util method to determine an ident func for an HTTP request (See : https://github.com/dtheodor/flask-sqlalchemy-session/issues/14#issuecomment-1227976421)
|
|
5
|
+
try:
|
|
6
|
+
from greenlet import getcurrent as _ident_func
|
|
7
|
+
except ImportError:
|
|
8
|
+
from threading import get_ident as _ident_func
|
|
9
|
+
|
|
10
|
+
class ConnexionApp(FlaskApp):
|
|
11
|
+
def __init__(self, *args, **kwargs):
|
|
12
|
+
super().__init__(*args, **kwargs)
|
|
13
|
+
|
|
14
|
+
def add_before_request_func(self, func):
|
|
15
|
+
if not callable(func):
|
|
16
|
+
raise TypeError("'{}' object if not callable".format(func))
|
|
17
|
+
self.app.before_request(func)
|
|
18
|
+
|
|
19
|
+
def add_teardown_request_func(self, func):
|
|
20
|
+
if not callable(func):
|
|
21
|
+
raise TypeError("'{}' object if not callable".format(func))
|
|
22
|
+
self.app.teardown_request(func)
|
|
23
|
+
|
|
24
|
+
def setup_api(self, specification, **kwargs):
|
|
25
|
+
api = self.add_api(specification, name=specification, **kwargs)
|
|
26
|
+
|
|
27
|
+
return api
|
|
28
|
+
|
|
29
|
+
def app_context(self, *args, **kwargs): # pragma: no cover
|
|
30
|
+
return self.app.app_context(*args, **kwargs)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "lcdp-flask-utils"
|
|
3
|
+
# https://github.com/python-poetry/poetry/issues/1208
|
|
4
|
+
version = "1.5.8"
|
|
5
|
+
description = "Flask Utils"
|
|
6
|
+
authors = ["Le Comptoir Des Pharmacies <webmaster@lecomptoirdespharmacies.fr>"]
|
|
7
|
+
|
|
8
|
+
[tool.poetry-dynamic-versioning]
|
|
9
|
+
enable = false
|
|
10
|
+
vcs = "git"
|
|
11
|
+
|
|
12
|
+
[tool.poetry.requires-plugins]
|
|
13
|
+
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
|
|
14
|
+
|
|
15
|
+
[tool.poetry.dependencies]
|
|
16
|
+
python = ">=3.8"
|
|
17
|
+
connexion = { extras = ["uvicorn"], version = "3.1.0" }
|
|
18
|
+
a2wsgi = "1.10.7"
|
|
19
|
+
|
|
20
|
+
[tool.poetry.dev-dependencies]
|
|
21
|
+
|
|
22
|
+
[build-system]
|
|
23
|
+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
|
|
24
|
+
build-backend = "poetry_dynamic_versioning.backend"
|