commit:     4d85ff822bc04099520312b6a8c3d65367fc8982
Author:     Joe Kappus <joe <AT> wt <DOT> gd>
AuthorDate: Wed Nov 26 19:54:40 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 05:50:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d85ff82

dev-python/sabctools: enable py3.14

Adds a patch from upstream to fix failing test on 3.14.

Signed-off-by: Joe Kappus <joe <AT> wt.gd>
Part-of: https://github.com/gentoo/gentoo/pull/44787
Closes: https://github.com/gentoo/gentoo/pull/44787
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/sabctools-8.2.6-py314testfix.patch       | 46 ++++++++++++++++++++++
 dev-python/sabctools/sabctools-8.2.6.ebuild        |  4 +-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/dev-python/sabctools/files/sabctools-8.2.6-py314testfix.patch 
b/dev-python/sabctools/files/sabctools-8.2.6-py314testfix.patch
new file mode 100644
index 000000000000..50b26be43caf
--- /dev/null
+++ b/dev-python/sabctools/files/sabctools-8.2.6-py314testfix.patch
@@ -0,0 +1,46 @@
+diff --git a/tests/test_decoder.py b/tests/test_decoder.py
+index 9503923..d45e607 100644
+--- a/tests/test_decoder.py
++++ b/tests/test_decoder.py
+@@ -76,29 +76,32 @@ def test_empty():
+ 
+ def test_ref_counts():
+     """Note that sys.getrefcount itself adds another reference!"""
++    # In Python 3.14+, getrefcount returns 1, in earlier versions it returns 2
++    expected_refcount = 1 if sys.version_info >= (3, 14) else 2
++    
+     # Test regular case
+     data_plain = read_plain_yenc_file("test_regular.yenc")
+     data_out, filename, filesize, begin, end, crc_correct = 
sabctools_yenc_wrapper(data_plain)
+ 
+-    assert sys.getrefcount(data_plain) == 2
+-    assert sys.getrefcount(data_out) == 2
+-    assert sys.getrefcount(filename) == 2
+-    assert sys.getrefcount(begin) == 2
+-    assert sys.getrefcount(end) == 2
+-    assert sys.getrefcount(crc_correct) == 2
++    assert sys.getrefcount(data_plain) == expected_refcount
++    assert sys.getrefcount(data_out) == expected_refcount
++    assert sys.getrefcount(filename) == expected_refcount
++    assert sys.getrefcount(begin) == expected_refcount
++    assert sys.getrefcount(end) == expected_refcount
++    assert sys.getrefcount(crc_correct) == expected_refcount
+ 
+     # Test simple error case
+     fake_inp = memoryview(bytearray(b"1234"))
+-    assert sys.getrefcount(fake_inp) == 2
++    assert sys.getrefcount(fake_inp) == expected_refcount
+     with pytest.raises(ValueError):
+         sabctools.yenc_decode(fake_inp)
+-    assert sys.getrefcount(fake_inp) == 2
++    assert sys.getrefcount(fake_inp) == expected_refcount
+ 
+     # Test further processing
+     data_plain = read_plain_yenc_file("test_bad_crc_end.yenc")
+     with pytest.raises(ValueError):
+         sabctools_yenc_wrapper(data_plain)
+-    assert sys.getrefcount(data_plain) == 2
++    assert sys.getrefcount(data_plain) == expected_refcount
+ 
+ 
+ def test_crc_pickles():

diff --git a/dev-python/sabctools/sabctools-8.2.6.ebuild 
b/dev-python/sabctools/sabctools-8.2.6.ebuild
index 474c96ed7d2a..c94e4800d27f 100644
--- a/dev-python/sabctools/sabctools-8.2.6.ebuild
+++ b/dev-python/sabctools/sabctools-8.2.6.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{11..13} )
+PYTHON_COMPAT=( python3_{11..14} )
 
 inherit distutils-r1
 
@@ -27,6 +27,8 @@ LICENSE="LGPL-3"
 SLOT="0"
 KEYWORDS="amd64 ~x86"
 
+PATCHES=( "${FILESDIR}/${P}-py314testfix.patch" )
+
 BDEPEND="
        test? (
                dev-python/chardet[${PYTHON_USEDEP}]

Reply via email to