From c44123f79f40edf5fe3d4b0d211d6aa68542abd2 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 3 Feb 2024 17:44:31 +0000 Subject: gentoo auto-resync : 03:02:2024 - 17:44:31 --- dev-python/pytest-trio/Manifest | 5 +- .../pytest-trio/files/pytest-trio-0.8.0-test.patch | 52 ++++++++++++++++++++ dev-python/pytest-trio/metadata.xml | 4 ++ dev-python/pytest-trio/pytest-trio-0.8.0-r1.ebuild | 56 ++++++++++++++++++++++ dev-python/pytest-trio/pytest-trio-0.8.0.ebuild | 51 -------------------- 5 files changed, 115 insertions(+), 53 deletions(-) create mode 100644 dev-python/pytest-trio/files/pytest-trio-0.8.0-test.patch create mode 100644 dev-python/pytest-trio/pytest-trio-0.8.0-r1.ebuild delete mode 100644 dev-python/pytest-trio/pytest-trio-0.8.0.ebuild (limited to 'dev-python/pytest-trio') diff --git a/dev-python/pytest-trio/Manifest b/dev-python/pytest-trio/Manifest index cee564600e3a..1318d7976ac3 100644 --- a/dev-python/pytest-trio/Manifest +++ b/dev-python/pytest-trio/Manifest @@ -1,3 +1,4 @@ +AUX pytest-trio-0.8.0-test.patch 1813 BLAKE2B 5c9feb01f75dbb302d4f4ab833affc5c02e9a2dde53e9c49425ac4acec25b25a8d9e5f7b68f00e00268841b6072c5aae9439ce2747c1d3cc7f9403d47631a5dd SHA512 bdd5457127949bb7d36e4427140ce99db3c914f26dcdea607ca12947f273487d3320206741a669e27f4fb34f8980f1842d87110a4b7cc460c6ffb5605a6f760f DIST pytest-trio-0.8.0.tar.gz 46525 BLAKE2B 54660dc9b021af0ec18eace72f053223d16e89635c74d71329a005e5fee3bf6e2055cc29412d9de7443b2594ee53d68890d1e30ed7c94560c355d4342bb3d035 SHA512 79141021633b7b2d8a840d7eaf6a3447bccd59d1bd4909e7feba88a9ae8244376f281b64fde4333b5a575957e3f73028e389a9abf0d19a35417f15c47eeccd05 -EBUILD pytest-trio-0.8.0.ebuild 1325 BLAKE2B 9e8a99f764e1f79ad49b5bd02b57144186553e1710b31ba7835e3406af5981a859025b2cda68107e14e25b37bb56dfa30b8d7adce2f6599be595381277a19df5 SHA512 25972f7b6113cbacbf0cbd021bba28bf65fbc00f39f20baa898eb90270102bfb48c017ff17b56ebeba2ce814e85fabb245aeb2f33b2dd36525ec2e7a8eb43ce1 -MISC metadata.xml 420 BLAKE2B 42bae65fb9b23797c96bdc057faebc577f89f0c83f27031079176c2a122cb15e70eb5937a8cd52d09b3d7c5a7d16f62768452c87523fdb0fad876b63836c171d SHA512 5dd3d9e96df753347ccdf41428b5faa1df217985d7cfda1d7bd933fdf755f8f254fd9fa80e7cbeedff318327c4ff4257d8598a17def8ee6144d27aa89305cc3d +EBUILD pytest-trio-0.8.0-r1.ebuild 1434 BLAKE2B 9f502cbcce71bcbf7e734b983a1743d0312837c017e88cebea10a2b55a117347a447af9f703cde84d593182c0f7c8c1c29e13ad3c42a7223bdf1538f36fa0d04 SHA512 eb05be9855a36311053a93ef510fe61280f374b21f44ebc63b7742077c67d10d88e944b51893a190eae90bde7c7405d6d39ce027115e5fa186d29169b1c061aa +MISC metadata.xml 521 BLAKE2B 330ebeab4ff6df94e8c813af8dd789aeced74dd28e673ea9458a95a0855007738f81c37acce03cde17c599ac6168e853d583565ac1a3bfd8fea96eb353236ebb SHA512 b4f2f3152d0a7d40d2c21311b5d2efe3593ee69df35c4b2c5653ae2c2ca7eb46dc0885fc8b97d44ff934c7d86209898d027c9ebb51221729fe1f3d912ffd3ae4 diff --git a/dev-python/pytest-trio/files/pytest-trio-0.8.0-test.patch b/dev-python/pytest-trio/files/pytest-trio-0.8.0-test.patch new file mode 100644 index 000000000000..a65fd2aee071 --- /dev/null +++ b/dev-python/pytest-trio/files/pytest-trio-0.8.0-test.patch @@ -0,0 +1,52 @@ +From 9cda20bbb966fe1e4ae51921d566c668654ee5e1 Mon Sep 17 00:00:00 2001 +From: Vincent Vanlaer +Date: Sun, 3 Sep 2023 00:00:54 +0200 +Subject: [PATCH 1/2] Remove trio.tests import causing warnings + +It is deprecated and the replacement is made private as trio._tests. +While we could be using that, this commit copies over the one relevant +function that is actually necessary. The other two imports just repeat +tests that are already in trio and do not need repeating here. +--- + .../_tests/test_hypothesis_interaction.py | 21 ++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/pytest_trio/_tests/test_hypothesis_interaction.py b/pytest_trio/_tests/test_hypothesis_interaction.py +index 75aa9f7..cb95a96 100644 +--- a/pytest_trio/_tests/test_hypothesis_interaction.py ++++ b/pytest_trio/_tests/test_hypothesis_interaction.py +@@ -1,10 +1,5 @@ + import pytest + import trio +-from trio.tests.test_scheduler_determinism import ( +- scheduler_trace, +- test_the_trio_scheduler_is_not_deterministic, +- test_the_trio_scheduler_is_deterministic_if_seeded, +-) + from hypothesis import given, settings, strategies as st + + from pytest_trio.plugin import _trio_test_runner_factory +@@ -38,6 +33,22 @@ async def test_mark_and_parametrize(x, y): + assert y in (1, 2) + + ++async def scheduler_trace(): ++ """Returns a scheduler-dependent value we can use to check determinism.""" ++ trace = [] ++ ++ async def tracer(name): ++ for i in range(10): ++ trace.append((name, i)) ++ await trio.sleep(0) ++ ++ async with trio.open_nursery() as nursery: ++ for i in range(5): ++ nursery.start_soon(tracer, i) ++ ++ return tuple(trace) ++ ++ + def test_the_trio_scheduler_is_deterministic_under_hypothesis(): + traces = [] + + diff --git a/dev-python/pytest-trio/metadata.xml b/dev-python/pytest-trio/metadata.xml index 485f7038656c..a0206c25c87f 100644 --- a/dev-python/pytest-trio/metadata.xml +++ b/dev-python/pytest-trio/metadata.xml @@ -5,6 +5,10 @@ andrewammerlaan@gentoo.org Andrew Ammerlaan + + python@gentoo.org + Python + python-trio/pytest-trio diff --git a/dev-python/pytest-trio/pytest-trio-0.8.0-r1.ebuild b/dev-python/pytest-trio/pytest-trio-0.8.0-r1.ebuild new file mode 100644 index 000000000000..a73c87ac4e00 --- /dev/null +++ b/dev-python/pytest-trio/pytest-trio-0.8.0-r1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYPI_NO_NORMALIZE=1 +PYTHON_COMPAT=( pypy3 python3_{10..12} ) + +inherit distutils-r1 pypi + +DESCRIPTION="This is a pytest plugin to help you test projects that use Trio" +HOMEPAGE=" + https://github.com/python-trio/pytest-trio + https://pypi.org/project/pytest-trio/ +" + +LICENSE="|| ( MIT Apache-2.0 )" +SLOT="0" +KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" + +RDEPEND=" + >=dev-python/outcome-1.1.0[${PYTHON_USEDEP}] + >=dev-python/pytest-7.2.0[${PYTHON_USEDEP}] + >=dev-python/trio-0.22.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + >=dev-python/hypothesis-3.64[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest +distutils_enable_sphinx docs/source \ + dev-python/attrs \ + dev-python/sphinx-rtd-theme \ + dev-python/sphinxcontrib-trio + +python_prepare_all() { + local PATCHES=( + # https://github.com/python-trio/pytest-trio/pull/135 + "${FILESDIR}/${P}-test.patch" + ) + + # Defining 'pytest_plugins' in a non-top-level conftest is no longer supported: + mv pytest_trio/_tests/conftest.py conftest.py || die + distutils-r1_python_prepare_all +} + +python_test() { + # disable autoloading pytest-asyncio in nested pytest calls + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + # since we disabled autoloading, force loading pytest-trio + local -x PYTEST_PLUGINS=pytest_trio.plugin + epytest +} diff --git a/dev-python/pytest-trio/pytest-trio-0.8.0.ebuild b/dev-python/pytest-trio/pytest-trio-0.8.0.ebuild deleted file mode 100644 index 4159233367eb..000000000000 --- a/dev-python/pytest-trio/pytest-trio-0.8.0.ebuild +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYPI_NO_NORMALIZE=1 -PYTHON_COMPAT=( pypy3 python3_{10..12} ) - -inherit distutils-r1 pypi - -DESCRIPTION="This is a pytest plugin to help you test projects that use Trio" -HOMEPAGE=" - https://github.com/python-trio/pytest-trio - https://pypi.org/project/pytest-trio/ -" - -LICENSE="|| ( MIT Apache-2.0 )" -SLOT="0" -KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" - -RDEPEND=" - >=dev-python/outcome-1.1.0[${PYTHON_USEDEP}] - >=dev-python/pytest-7.2.0[${PYTHON_USEDEP}] - >=dev-python/trio-0.22.0[${PYTHON_USEDEP}] -" -BDEPEND=" - test? ( - >=dev-python/hypothesis-3.64[${PYTHON_USEDEP}] - ) -" - -distutils_enable_tests pytest -distutils_enable_sphinx docs/source \ - dev-python/attrs \ - dev-python/sphinx-rtd-theme \ - dev-python/sphinxcontrib-trio - -python_prepare_all() { - # Defining 'pytest_plugins' in a non-top-level conftest is no longer supported: - mv pytest_trio/_tests/conftest.py conftest.py || die - distutils-r1_python_prepare_all -} - -python_test() { - # disable autoloading pytest-asyncio in nested pytest calls - local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 - # since we disabled autoloading, force loading pytest-trio - local -x PYTEST_PLUGINS=pytest_trio.plugin - epytest -} -- cgit v1.2.3