commit:     336b08c335da578ffcc00b9bec66cb64ec0c8f56
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 13 11:09:19 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 13 11:27:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=336b08c3

dev-python/tqdm: Enable py3.10

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

 dev-python/tqdm/files/tqdm-4.61.1-py310.patch | 35 +++++++++++++++++++++++++++
 dev-python/tqdm/tqdm-4.61.1.ebuild            |  6 ++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/dev-python/tqdm/files/tqdm-4.61.1-py310.patch 
b/dev-python/tqdm/files/tqdm-4.61.1-py310.patch
new file mode 100644
index 00000000000..10cb898d480
--- /dev/null
+++ b/dev-python/tqdm/files/tqdm-4.61.1-py310.patch
@@ -0,0 +1,35 @@
+From d2a6ec2ab84aec847b1598bb2a777103cea7fc9f Mon Sep 17 00:00:00 2001
+From: Casper da Costa-Luis <t...@cdcl.ml>
+Date: Sat, 12 Jun 2021 17:39:37 +0100
+Subject: [PATCH] fix py3.10 `asyncio` tests
+
+- fixes #1176
+---
+ tqdm/asyncio.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tqdm/asyncio.py b/tqdm/asyncio.py
+index 0d3ba747d..8f9b4ed6e 100644
+--- a/tqdm/asyncio.py
++++ b/tqdm/asyncio.py
+@@ -8,6 +8,7 @@
+ ...     ...
+ """
+ import asyncio
++from sys import version_info
+ 
+ from .std import tqdm as std_tqdm
+ 
+@@ -60,7 +61,11 @@ def as_completed(cls, fs, *, loop=None, timeout=None, 
total=None, **tqdm_kwargs)
+         """
+         if total is None:
+             total = len(fs)
+-        yield from cls(asyncio.as_completed(fs, loop=loop, timeout=timeout),
++
++        kwargs = {}
++        if version_info[:2] < (3, 10):
++            kwargs['loop'] = loop
++        yield from cls(asyncio.as_completed(fs, timeout=timeout, **kwargs),
+                        total=total, **tqdm_kwargs)
+ 
+     @classmethod

diff --git a/dev-python/tqdm/tqdm-4.61.1.ebuild 
b/dev-python/tqdm/tqdm-4.61.1.ebuild
index efd3b71ffe2..52874533157 100644
--- a/dev-python/tqdm/tqdm-4.61.1.ebuild
+++ b/dev-python/tqdm/tqdm-4.61.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( pypy3 python3_{8..9} )
+PYTHON_COMPAT=( pypy3 python3_{8..10} )
 inherit distutils-r1
 
 if [[ ${PV} == 9999 ]]; then
@@ -31,6 +31,10 @@ BDEPEND="
 
 distutils_enable_tests pytest
 
+PATCHES=(
+       "${FILESDIR}"/${P}-py310.patch
+)
+
 python_test() {
        # Skip unpredictable performance tests
        epytest --ignore 'tests/tests_perf.py'

Reply via email to