diff --git a/dev-python/flask-restx/files/flask-restx-avoid-importlib_resources.patch b/dev-python/flask-restx/files/flask-restx-avoid-importlib_resources.patch new file mode 100644 index 0000000000..cda8a054f7 --- /dev/null +++ b/dev-python/flask-restx/files/flask-restx-avoid-importlib_resources.patch @@ -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) diff --git a/dev-python/flask-restx/flask-restx-1.3.0.ebuild b/dev-python/flask-restx/flask-restx-1.3.0.ebuild index 51c5db5d93..3acfd76212 100644 --- a/dev-python/flask-restx/flask-restx-1.3.0.ebuild +++ b/dev-python/flask-restx/flask-restx-1.3.0.ebuild @@ -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() {