dev-python/flask-restx: avoid importlib-resources dep

Signed-off-by: David Roman <davidroman96@gmail.com>
This commit is contained in:
David Roman
2024-04-25 21:07:05 +02:00
parent dd413101d3
commit 85b6342060
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
diff --git a/flask_restx/schemas/__init__.py b/flask_restx/schemas/__init__.py
index 27b9866..4369737 100644
--- a/flask_restx/schemas/__init__.py
+++ b/flask_restx/schemas/__init__.py
@@ -7,7 +7,7 @@ and allows to validate specs against them.
import io
import json
-import importlib_resources
+import importlib.resources
from collections.abc import Mapping
from jsonschema import Draft4Validator
@@ -57,7 +57,7 @@ class LazySchema(Mapping):
def _load(self):
if not self._schema:
- ref = importlib_resources.files(__name__) / self.filename
+ ref = importlib.resources.files(__name__) / self.filename
with io.open(ref) as infile:
self._schema = json.load(infile)

View File

@@ -23,7 +23,6 @@ RDEPEND="
dev-python/pytz[${PYTHON_USEDEP}]
dev-python/six[${PYTHON_USEDEP}]
dev-python/werkzeug[${PYTHON_USEDEP}]
dev-python/importlib-resources[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}
@@ -36,6 +35,8 @@ DEPEND="${RDEPEND}
)
"
PATCHES=( "${FILESDIR}/${PN}-avoid-importlib_resources.patch" )
distutils_enable_tests pytest
python_test() {