commit: 541d443a1f26115980312130f0e63881f2ef86c8 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sat May 31 17:02:56 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat May 31 17:02:56 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=541d443a
dev-python/overrides: Enable py3.14 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../overrides/files/overrides-7.7.0-py314.patch | 35 ++++++++++++++++++++++ dev-python/overrides/overrides-7.7.0-r1.ebuild | 26 ++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/dev-python/overrides/files/overrides-7.7.0-py314.patch b/dev-python/overrides/files/overrides-7.7.0-py314.patch new file mode 100644 index 000000000000..22f32892146f --- /dev/null +++ b/dev-python/overrides/files/overrides-7.7.0-py314.patch @@ -0,0 +1,35 @@ +From 77f006c388ab3a93c88fb8aeb3d2bde20d585682 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]> +Date: Sat, 31 May 2025 18:58:45 +0200 +Subject: [PATCH] Fix `ImportError` on Python 3.14 due to missing + `typing.ByteString` + +Add `typing.ByteString` to `BUILTINS_MAPPING` only when it is present. +The type has been removed in Python 3.14. + +Fixes #127 +--- + overrides/typing_utils.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/overrides/typing_utils.py b/overrides/typing_utils.py +index f628d40..15ab796 100644 +--- a/overrides/typing_utils.py ++++ b/overrides/typing_utils.py +@@ -47,12 +47,15 @@ + typing.Set: set, + typing.Dict: dict, + typing.Tuple: tuple, +- typing.ByteString: bytes, # https://docs.python.org/3/library/typing.html#typing.ByteString + typing.Callable: collections.abc.Callable, + typing.Sequence: collections.abc.Sequence, + type(None): None, + } + ++if hasattr(typing, "ByteString"): ++ # https://docs.python.org/3/library/typing.html#typing.ByteString ++ BUILTINS_MAPPING[typing.ByteString] = bytes ++ + STATIC_SUBTYPE_MAPPING: typing.Dict[type, typing.Type] = { + io.TextIOWrapper: typing.TextIO, + io.TextIOBase: typing.TextIO, diff --git a/dev-python/overrides/overrides-7.7.0-r1.ebuild b/dev-python/overrides/overrides-7.7.0-r1.ebuild new file mode 100644 index 000000000000..29b824547a3e --- /dev/null +++ b/dev-python/overrides/overrides-7.7.0-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( pypy3_11 python3_{11..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="A decorator to automatically detect mismatch when overriding a method." +HOMEPAGE=" + https://pypi.org/project/overrides/ + https://github.com/mkorpela/overrides/ +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/mkorpela/overrides/pull/133 + "${FILESDIR}/${P}-py314.patch" +)
