public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/toolz/, dev-python/toolz/files/
@ 2021-06-20 22:59 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2021-06-20 22:59 UTC (permalink / raw
  To: gentoo-commits

commit:     d79035bd10b11df363568d9b6d01ed87157ec385
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 21:13:12 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 22:59:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d79035bd

dev-python/toolz: Enable py3.10

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

 dev-python/toolz/files/toolz-0.11.1-py310.patch | 25 +++++++++++++++++++++++++
 dev-python/toolz/toolz-0.11.1.ebuild            |  8 ++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/dev-python/toolz/files/toolz-0.11.1-py310.patch b/dev-python/toolz/files/toolz-0.11.1-py310.patch
new file mode 100644
index 00000000000..d926f3457ab
--- /dev/null
+++ b/dev-python/toolz/files/toolz-0.11.1-py310.patch
@@ -0,0 +1,25 @@
+From da81b1e8ab96b22ed81e6414099aba066633f3ff Mon Sep 17 00:00:00 2001
+From: Erik Welch <erik.n.welch@gmail.com>
+Date: Thu, 22 Apr 2021 00:20:24 -0500
+Subject: [PATCH] Support Python 3.10 by adding `anext` signature.
+
+Fixes #512
+---
+ .travis.yml          | 3 ++-
+ toolz/_signatures.py | 3 +++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/toolz/_signatures.py b/toolz/_signatures.py
+index 328cea91..3ce1616a 100644
+--- a/toolz/_signatures.py
++++ b/toolz/_signatures.py
+@@ -45,6 +45,9 @@
+         lambda x: None],
+     all=[
+         lambda iterable: None],
++    anext=[
++        lambda aiterator: None,
++        lambda aiterator, default: None],
+     any=[
+         lambda iterable: None],
+     apply=[

diff --git a/dev-python/toolz/toolz-0.11.1.ebuild b/dev-python/toolz/toolz-0.11.1.ebuild
index 5e86ca53155..5ba2982613f 100644
--- a/dev-python/toolz/toolz-0.11.1.ebuild
+++ b/dev-python/toolz/toolz-0.11.1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..10} )
 
 inherit distutils-r1
 
@@ -18,3 +18,7 @@ BDEPEND="
 	dev-python/versioneer[${PYTHON_USEDEP}]"
 
 distutils_enable_tests pytest
+
+PATCHES=(
+	"${FILESDIR}"/${P}-py310.patch
+)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/toolz/, dev-python/toolz/files/
@ 2024-06-18 17:59 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-06-18 17:59 UTC (permalink / raw
  To: gentoo-commits

commit:     dcd3780f610c9f72ed022124dbe5460966627c54
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 17:47:34 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 17:59:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dcd3780f

dev-python/toolz: Grab test fixes from upstream PR

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

 dev-python/toolz/files/toolz-0.12.1-test.patch | 88 ++++++++++++++++++++++++++
 dev-python/toolz/toolz-0.12.1.ebuild           |  5 ++
 2 files changed, 93 insertions(+)

diff --git a/dev-python/toolz/files/toolz-0.12.1-test.patch b/dev-python/toolz/files/toolz-0.12.1-test.patch
new file mode 100644
index 000000000000..396ed003a62e
--- /dev/null
+++ b/dev-python/toolz/files/toolz-0.12.1-test.patch
@@ -0,0 +1,88 @@
+From b79a954ca5fa6801c3a3dc6b39fa523be33884a8 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Fri, 14 Jun 2024 13:43:24 -0700
+Subject: [PATCH 1/2] test_excepts: fudge changed indentation in Python 3.13
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+---
+ toolz/tests/test_functoolz.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/toolz/tests/test_functoolz.py b/toolz/tests/test_functoolz.py
+index 555cf48d..a28c2a77 100644
+--- a/toolz/tests/test_functoolz.py
++++ b/toolz/tests/test_functoolz.py
+@@ -738,10 +738,13 @@ def f(a, b):
+ def test_excepts():
+     # These are descriptors, make sure this works correctly.
+     assert excepts.__name__ == 'excepts'
++    # in Python < 3.13 the second line is indented, in 3.13+
++    # it is not, strip all lines to fudge it
++    testlines = "\n".join((line.strip() for line in excepts.__doc__.splitlines()))
+     assert (
+         'A wrapper around a function to catch exceptions and\n'
+-        '    dispatch to a handler.\n'
+-    ) in excepts.__doc__
++        'dispatch to a handler.\n'
++    ) in testlines
+ 
+     def idx(a):
+         """idx docstring
+
+From 832e81d28882d1235c704de95e1d075ee61976c1 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Fri, 14 Jun 2024 16:03:30 -0700
+Subject: [PATCH 2/2] test_inspect_wrapped_property: handle fixed wrapper
+ inspection
+
+Python upstream recently fixed the behavior of inspect with
+wrappers: https://github.com/python/cpython/issues/112006 . The
+assertion here relies on the broken behavior, we only get None
+if `inspect(Wrapped)` fails and raises `ValueError`. Now it
+works, we actually get the correct answer, 1. This changes it so
+we assert the correct thing depending on the Python version (the
+fix was backported to 3.11.9 and 3.12.3, so the check has to be a
+bit complicated).
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+---
+ toolz/tests/test_inspect_args.py | 21 +++++++++++++++++++--
+ 1 file changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/toolz/tests/test_inspect_args.py b/toolz/tests/test_inspect_args.py
+index 93408eb5..f26dbc64 100644
+--- a/toolz/tests/test_inspect_args.py
++++ b/toolz/tests/test_inspect_args.py
+@@ -2,6 +2,7 @@
+ import inspect
+ import itertools
+ import operator
++import sys
+ import toolz
+ from toolz.functoolz import (curry, is_valid_args, is_partial_args, is_arity,
+                              num_required_args, has_varargs, has_keywords)
+@@ -482,6 +483,22 @@ def __wrapped__(self):
+     wrapped = Wrapped(func)
+     assert inspect.signature(func) == inspect.signature(wrapped)
+ 
+-    assert num_required_args(Wrapped) is None
+-    _sigs.signatures[Wrapped] = (_sigs.expand_sig((0, lambda func: None)),)
++    # inspect.signature did not used to work properly on wrappers,
++    # but it was fixed in Python 3.11.9, Python 3.12.3 and Python
++    # 3.13+
++    inspectbroken = True
++    if sys.version_info.major > 3:
++        inspectbroken = False
++    if sys.version_info.major == 3:
++        if sys.version_info.minor == 11 and sys.version_info.micro > 8:
++            inspectbroken = False
++        if sys.version_info.minor == 12 and sys.version_info.micro > 2:
++            inspectbroken = False
++        if sys.version_info.minor > 12:
++            inspectbroken = False
++
++    if inspectbroken:
++        assert num_required_args(Wrapped) is None
++        _sigs.signatures[Wrapped] = (_sigs.expand_sig((0, lambda func: None)),)
++
+     assert num_required_args(Wrapped) == 1

diff --git a/dev-python/toolz/toolz-0.12.1.ebuild b/dev-python/toolz/toolz-0.12.1.ebuild
index 111952a712ff..50e255d72b8d 100644
--- a/dev-python/toolz/toolz-0.12.1.ebuild
+++ b/dev-python/toolz/toolz-0.12.1.ebuild
@@ -20,6 +20,11 @@ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ppc ppc64 ~riscv ~s390 ~spar
 
 distutils_enable_tests pytest
 
+PATCHES=(
+	# https://github.com/pytoolz/toolz/pull/582
+	"${FILESDIR}/${P}-test.patch"
+)
+
 python_test() {
 	local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
 	epytest


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-18 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-20 22:59 [gentoo-commits] repo/gentoo:master commit in: dev-python/toolz/, dev-python/toolz/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18 17:59 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox