summaryrefslogtreecommitdiff
path: root/dev-python
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-05-12 10:01:31 +0100
committerSam James <sam@gentoo.org>2025-05-12 11:02:51 +0100
commita18ed378dae2f5933e857a94b84fa1067dd2f2a6 (patch)
treed78c57c07c27365c28cb741303c200e0df0f2442 /dev-python
parent19bd8545c56f96dcaa7018e2b6ca5a265237df99 (diff)
downloadgentoo-a18ed378dae2f5933e857a94b84fa1067dd2f2a6.tar.gz
gentoo-a18ed378dae2f5933e857a94b84fa1067dd2f2a6.tar.bz2
gentoo-a18ed378dae2f5933e857a94b84fa1067dd2f2a6.zip
dev-python/flask: enable py3.14
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/flask/files/flask-3.1.0-py314.patch93
-rw-r--r--dev-python/flask/flask-3.1.0.ebuild7
2 files changed, 99 insertions, 1 deletions
diff --git a/dev-python/flask/files/flask-3.1.0-py314.patch b/dev-python/flask/files/flask-3.1.0-py314.patch
new file mode 100644
index 000000000000..a03ef8cd9d56
--- /dev/null
+++ b/dev-python/flask/files/flask-3.1.0-py314.patch
@@ -0,0 +1,93 @@
+https://github.com/pallets/flask/issues/5692
+https://github.com/pallets/flask/pull/5702
+
+From 41ec5760a2c55a099c3a1733fdd36fbb1258a02b Mon Sep 17 00:00:00 2001
+From: David Lord <davidism@gmail.com>
+Date: Sat, 29 Mar 2025 15:42:58 -0700
+Subject: [PATCH] remove tests about deprecated pkgutil.get_loader
+
+---
+ tests/conftest.py | 32 --------------------------------
+ tests/test_instance_config.py | 6 +++---
+ 2 files changed, 3 insertions(+), 35 deletions(-)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 58cf85d8a5..214f520338 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -1,5 +1,4 @@
+ import os
+-import pkgutil
+ import sys
+
+ import pytest
+@@ -96,37 +95,6 @@ def leak_detector():
+ assert leaks == []
+
+
+-@pytest.fixture(params=(True, False))
+-def limit_loader(request, monkeypatch):
+- """Patch pkgutil.get_loader to give loader without get_filename or archive.
+-
+- This provides for tests where a system has custom loaders, e.g. Google App
+- Engine's HardenedModulesHook, which have neither the `get_filename` method
+- nor the `archive` attribute.
+-
+- This fixture will run the testcase twice, once with and once without the
+- limitation/mock.
+- """
+- if not request.param:
+- return
+-
+- class LimitedLoader:
+- def __init__(self, loader):
+- self.loader = loader
+-
+- def __getattr__(self, name):
+- if name in {"archive", "get_filename"}:
+- raise AttributeError(f"Mocking a loader which does not have {name!r}.")
+- return getattr(self.loader, name)
+-
+- old_get_loader = pkgutil.get_loader
+-
+- def get_loader(*args, **kwargs):
+- return LimitedLoader(old_get_loader(*args, **kwargs))
+-
+- monkeypatch.setattr(pkgutil, "get_loader", get_loader)
+-
+-
+ @pytest.fixture
+ def modules_tmp_path(tmp_path, monkeypatch):
+ """A temporary directory added to sys.path."""
+diff --git a/tests/test_instance_config.py b/tests/test_instance_config.py
+index 1918bd999d..835a87844d 100644
+--- a/tests/test_instance_config.py
++++ b/tests/test_instance_config.py
+@@ -63,7 +63,7 @@ def create_namespace(package):
+
+
+ def test_installed_module_paths(
+- modules_tmp_path, modules_tmp_path_prefix, purge_module, site_packages, limit_loader
++ modules_tmp_path, modules_tmp_path_prefix, purge_module, site_packages
+ ):
+ (site_packages / "site_app.py").write_text(
+ "import flask\napp = flask.Flask(__name__)\n"
+@@ -78,7 +78,7 @@ def test_installed_module_paths(
+
+
+ def test_installed_package_paths(
+- limit_loader, modules_tmp_path, modules_tmp_path_prefix, purge_module, monkeypatch
++ modules_tmp_path, modules_tmp_path_prefix, purge_module, monkeypatch
+ ):
+ installed_path = modules_tmp_path / "path"
+ installed_path.mkdir()
+@@ -97,7 +97,7 @@ def test_installed_package_paths(
+
+
+ def test_prefix_package_paths(
+- limit_loader, modules_tmp_path, modules_tmp_path_prefix, purge_module, site_packages
++ modules_tmp_path, modules_tmp_path_prefix, purge_module, site_packages
+ ):
+ app = site_packages / "site_package"
+ app.mkdir()
+
diff --git a/dev-python/flask/flask-3.1.0.ebuild b/dev-python/flask/flask-3.1.0.ebuild
index 06a06caa4ba6..b6dc0aac1278 100644
--- a/dev-python/flask/flask-3.1.0.ebuild
+++ b/dev-python/flask/flask-3.1.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=flit
-PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
+PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
inherit distutils-r1
@@ -40,6 +40,11 @@ BDEPEND="
)
"
+PATCHES=(
+ # https://github.com/pallets/flask/pull/5702
+ "${FILESDIR}/${PN}-3.1.0-py314.patch"
+)
+
distutils_enable_sphinx docs \
dev-python/pallets-sphinx-themes \
dev-python/sphinx-issues \