commit:     7c1b1e277d01420db29b7fedea9dcb1d3b36fb02
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  6 19:24:56 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr  6 19:40:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c1b1e27

dev-python/anyio: Fix tests, PEP 517 build

Closes: https://bugs.gentoo.org/832870
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../{anyio-3.5.0.ebuild => anyio-3.5.0-r1.ebuild}  | 13 ++--
 dev-python/anyio/files/anyio-3.5.0-pytest-7.patch  | 78 ++++++++++++++++++++++
 2 files changed, 87 insertions(+), 4 deletions(-)

diff --git a/dev-python/anyio/anyio-3.5.0.ebuild 
b/dev-python/anyio/anyio-3.5.0-r1.ebuild
similarity index 85%
rename from dev-python/anyio/anyio-3.5.0.ebuild
rename to dev-python/anyio/anyio-3.5.0-r1.ebuild
index 5379b452a5e4..cbbb327c2923 100644
--- a/dev-python/anyio/anyio-3.5.0.ebuild
+++ b/dev-python/anyio/anyio-3.5.0-r1.ebuild
@@ -3,12 +3,14 @@
 
 EAPI=8
 
+DISTUTILS_USE_PEP517=setuptools
 PYTHON_COMPAT=( python3_{8..10} )
+
 inherit distutils-r1
 
 DESCRIPTION="Compatibility layer for multiple asynchronous event loop 
implementations"
 HOMEPAGE="
-       https://github.com/agronholm/anyio
+       https://github.com/agronholm/anyio/
        https://pypi.org/project/anyio/
 "
 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
@@ -26,20 +28,23 @@ RDEPEND="
 BDEPEND="
        test? (
                >=dev-python/hypothesis-4.0[${PYTHON_USEDEP}]
-               >=dev-python/pytest-6.2[${PYTHON_USEDEP}]
+               >=dev-python/pytest-7[${PYTHON_USEDEP}]
                >=dev-python/pytest-mock-3.6.1[${PYTHON_USEDEP}]
                dev-python/trustme[${PYTHON_USEDEP}]
                amd64? ( >=dev-python/uvloop-0.15[${PYTHON_USEDEP}] )
        )
 "
 
-distutils_enable_tests --install pytest
+distutils_enable_tests pytest
 distutils_enable_sphinx docs \
        dev-python/sphinx_rtd_theme \
        dev-python/sphinx-autodoc-typehints
 
+PATCHES=(
+       "${FILESDIR}"/${P}-pytest-7.patch
+)
+
 python_test() {
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-       distutils_install_for_testing --via-venv
        epytest -m 'not network'
 }

diff --git a/dev-python/anyio/files/anyio-3.5.0-pytest-7.patch 
b/dev-python/anyio/files/anyio-3.5.0-pytest-7.patch
new file mode 100644
index 000000000000..858404632959
--- /dev/null
+++ b/dev-python/anyio/files/anyio-3.5.0-pytest-7.patch
@@ -0,0 +1,78 @@
+From fed7cc4f95e196f68251bcb9253da3b143ea8e7e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <[email protected]>
+Date: Mon, 7 Feb 2022 00:16:18 +0200
+Subject: [PATCH] Upgraded pytest to 7.0
+
+---
+ setup.cfg                   |  2 +-
+ tests/test_pytest_plugin.py | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py
+index 4255702..f3b0e0c 100644
+--- a/tests/test_pytest_plugin.py
++++ b/tests/test_pytest_plugin.py
+@@ -1,5 +1,5 @@
+ import pytest
+-from _pytest.pytester import Testdir
++from _pytest.pytester import Pytester
+ 
+ from anyio import get_all_backends
+ 
+@@ -9,7 +9,7 @@ pytestmark = pytest.mark.filterwarnings(
+ pytest_args = '-v', '-p', 'anyio', '-p', 'no:asyncio'
+ 
+ 
+-def test_plugin(testdir: Testdir) -> None:
++def test_plugin(testdir: Pytester) -> None:
+     testdir.makeconftest(
+         """
+         import sniffio
+@@ -67,7 +67,7 @@ def test_plugin(testdir: Testdir) -> None:
+     result.assert_outcomes(passed=3 * len(get_all_backends()), 
skipped=len(get_all_backends()))
+ 
+ 
+-def test_asyncio(testdir: Testdir) -> None:
++def test_asyncio(testdir: Pytester) -> None:
+     testdir.makeconftest(
+         """
+         import asyncio
+@@ -140,7 +140,7 @@ def test_asyncio(testdir: Testdir) -> None:
+     result.assert_outcomes(passed=2, failed=1, errors=2)
+ 
+ 
+-def test_autouse_async_fixture(testdir: Testdir) -> None:
++def test_autouse_async_fixture(testdir: Pytester) -> None:
+     testdir.makeconftest(
+         """
+         import pytest
+@@ -177,7 +177,7 @@ def test_autouse_async_fixture(testdir: Testdir) -> None:
+     result.assert_outcomes(passed=len(get_all_backends()))
+ 
+ 
+-def test_cancel_scope_in_asyncgen_fixture(testdir: Testdir) -> None:
++def test_cancel_scope_in_asyncgen_fixture(testdir: Pytester) -> None:
+     testdir.makepyfile(
+         """
+         import pytest
+@@ -204,7 +204,7 @@ def test_cancel_scope_in_asyncgen_fixture(testdir: 
Testdir) -> None:
+     result.assert_outcomes(passed=len(get_all_backends()))
+ 
+ 
+-def test_hypothesis_module_mark(testdir: Testdir) -> None:
++def test_hypothesis_module_mark(testdir: Pytester) -> None:
+     testdir.makepyfile(
+         """
+         import pytest
+@@ -235,7 +235,7 @@ def test_hypothesis_module_mark(testdir: Testdir) -> None:
+     result.assert_outcomes(passed=len(get_all_backends()) + 1, 
xfailed=len(get_all_backends()))
+ 
+ 
+-def test_hypothesis_function_mark(testdir: Testdir) -> None:
++def test_hypothesis_function_mark(testdir: Pytester) -> None:
+     testdir.makepyfile(
+         """
+         import pytest
+-- 
+2.35.1
+

Reply via email to