diff --git a/dev-util/pkgcheck/files/pkgcheck-0.10.40-py315.patch b/dev-util/pkgcheck/files/pkgcheck-0.10.40-py315.patch new file mode 100644 index 0000000000000..c2db4faadad80 --- /dev/null +++ b/dev-util/pkgcheck/files/pkgcheck-0.10.40-py315.patch @@ -0,0 +1,43 @@ +https://github.com/pkgcore/pkgcheck/issues/787 +https://github.com/pkgcore/pkgcheck/commit/d649977e79984afca90c61315fcab89cb8f9ef6a + +From d649977e79984afca90c61315fcab89cb8f9ef6a Mon Sep 17 00:00:00 2001 +From: Arthur Zamarin +Date: Sun, 5 Jul 2026 22:14:30 +0300 +Subject: [PATCH] tests: replace deprecated Loader.load_module with exec_module + +load_module() was removed in Python 3.15, breaking test_scan_repo[eclass]. +Use the recommended spec_from_loader + module_from_spec + exec_module API. + +Resolves: https://github.com/pkgcore/pkgcheck/issues/787 +Signed-off-by: Arthur Zamarin +--- + tests/scripts/test_pkgcheck_scan.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/tests/scripts/test_pkgcheck_scan.py b/tests/scripts/test_pkgcheck_scan.py +index 7aee972e8..11deb686b 100644 +--- a/tests/scripts/test_pkgcheck_scan.py ++++ b/tests/scripts/test_pkgcheck_scan.py +@@ -1,5 +1,6 @@ + import importlib + import importlib.machinery ++import importlib.util + import io + import os + import pathlib +@@ -608,9 +609,10 @@ def _load_expected_data(self, base: pathlib.Path) -> _expected_data_result: + with (custom_handler_path := base / "handler.py").open(): + # We can't import since it's not a valid python directory layout, nor do + # want to pollute the namespace. +- module = importlib.machinery.SourceFileLoader( +- "handler", str(custom_handler_path) +- ).load_module() ++ loader = importlib.machinery.SourceFileLoader("handler", str(custom_handler_path)) ++ spec = importlib.util.spec_from_loader("handler", loader) ++ module = importlib.util.module_from_spec(spec) ++ loader.exec_module(module) + if ( + custom_handler := typing.cast( + typing.Callable[[Result], bool], getattr(module, "handler") + diff --git a/dev-util/pkgcheck/pkgcheck-0.10.40-r1.ebuild b/dev-util/pkgcheck/pkgcheck-0.10.40-r1.ebuild index de2ffcfe03a6a..77240408eda58 100644 --- a/dev-util/pkgcheck/pkgcheck-0.10.40-r1.ebuild +++ b/dev-util/pkgcheck/pkgcheck-0.10.40-r1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=standalone -PYTHON_COMPAT=( python3_{12..14} ) +PYTHON_COMPAT=( python3_{12..15} ) inherit elisp-common distutils-r1 optfeature if [[ ${PV} == *9999 ]] ; then @@ -56,6 +56,10 @@ BDEPEND="${RDEPEND} SITEFILE="50${PN}-gentoo.el" +PATCHES=( + "${FILESDIR}"/${P}-py315.patch +) + EPYTEST_PLUGINS=( pkgcore ) distutils_enable_tests pytest diff --git a/dev-util/pkgcheck/pkgcheck-9999.ebuild b/dev-util/pkgcheck/pkgcheck-9999.ebuild index de2ffcfe03a6a..cd219c478bb76 100644 --- a/dev-util/pkgcheck/pkgcheck-9999.ebuild +++ b/dev-util/pkgcheck/pkgcheck-9999.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=standalone -PYTHON_COMPAT=( python3_{12..14} ) +PYTHON_COMPAT=( python3_{12..15} ) inherit elisp-common distutils-r1 optfeature if [[ ${PV} == *9999 ]] ; then