commit:     f904e2fa2555998cc17379487209edc881ac3972
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 18:50:51 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Oct 26 18:59:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f904e2fa

dev-python/confuse: Enable py3.14

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/confuse/confuse-2.0.1-r1.ebuild         | 32 +++++++++++++++++
 dev-python/confuse/files/confuse-2.0.1-py314.patch | 42 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)

diff --git a/dev-python/confuse/confuse-2.0.1-r1.ebuild 
b/dev-python/confuse/confuse-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..22b897433004
--- /dev/null
+++ b/dev-python/confuse/confuse-2.0.1-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=flit
+PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="A configuration library for Python that uses YAML"
+HOMEPAGE="
+       https://github.com/beetbox/confuse/
+       https://pypi.org/project/confuse/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests unittest
+distutils_enable_sphinx docs \
+       'dev-python/sphinx-rtd-theme'
+
+PATCHES=(
+       # 
https://github.com/beetbox/confuse/commit/ed79b4b9f53fe99293139c18f053168e564508b8
+       "${FILESDIR}/${P}-py314.patch"
+)

diff --git a/dev-python/confuse/files/confuse-2.0.1-py314.patch 
b/dev-python/confuse/files/confuse-2.0.1-py314.patch
new file mode 100644
index 000000000000..4fcc733df26b
--- /dev/null
+++ b/dev-python/confuse/files/confuse-2.0.1-py314.patch
@@ -0,0 +1,42 @@
+From ed79b4b9f53fe99293139c18f053168e564508b8 Mon Sep 17 00:00:00 2001
+From: wisp3rwind <[email protected]>
+Date: Thu, 17 Apr 2025 22:35:06 +0200
+Subject: [PATCH] address deprecation of  pkgutil.get_loader
+
+Closes https://github.com/beetbox/confuse/issues/165
+---
+ confuse/util.py | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/confuse/util.py b/confuse/util.py
+index c27e161..a3f6e62 100644
+--- a/confuse/util.py
++++ b/confuse/util.py
+@@ -1,9 +1,9 @@
++import importlib.util
+ import os
+ import sys
+ import argparse
+ import optparse
+ import platform
+-import pkgutil
+ 
+ 
+ UNIX_DIR_FALLBACK = '~/.config'
+@@ -114,8 +114,14 @@ def find_package_path(name):
+     None if the path could not be identified (e.g., if
+     ``name == "__main__"``).
+     """
+-    # Based on get_root_path from Flask by Armin Ronacher.
+-    loader = pkgutil.get_loader(name)
++    # Based on get_root_path from Flask by Armin Ronacher, cf.
++    # 
https://github.com/pallets/flask/blob/85c5d93cbd049c4bd0679c36fd1ddcae8c37b642/src/flask/helpers.py#L570
++    try:
++        spec = importlib.util.find_spec(name)
++    except (ImportError, ValueError):
++        return None
++
++    loader = spec.loader
+     if loader is None or name == '__main__':
+         return None
+ 

Reply via email to