From b6b2873322a589ec81305a8476b25107a1087574 Mon Sep 17 00:00:00 2001 From: Takuya Wakazono Date: Sun, 22 Sep 2024 17:25:56 +0900 Subject: [PATCH] dev-python/b2sdk: migrate to pytest-lazy-fixtures dev-python/pytest-lazy-fixture is broken with >=pytest-8 and replaced by dev-python/pytest-lazy-fixtures. Signed-off-by: Takuya Wakazono --- dev-python/b2sdk/b2sdk-2.3.0.ebuild | 11 +++- .../files/b2sdk-2.3.0-lazy-fixtures.patch | 56 +++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch diff --git a/dev-python/b2sdk/b2sdk-2.3.0.ebuild b/dev-python/b2sdk/b2sdk-2.3.0.ebuild index 9677228bcf..49246e375d 100644 --- a/dev-python/b2sdk/b2sdk-2.3.0.ebuild +++ b/dev-python/b2sdk/b2sdk-2.3.0.ebuild @@ -1,7 +1,7 @@ -# Copyright 2021-2022 Gentoo Authors +# Copyright 2021-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 DISTUTILS_USE_PEP517="pdm-backend" PYTHON_COMPAT=( python3_10 python3_11 python3_12 ) @@ -33,11 +33,16 @@ distutils_enable_tests pytest BDEPEND+=" test? ( $(python_gen_cond_dep ' >=dev-python/pytest-mock-3.6.1[${PYTHON_USEDEP}] - >=dev-python/pytest-lazy-fixture-0.6.3[${PYTHON_USEDEP}] + dev-python/pytest-lazy-fixtures[${PYTHON_USEDEP}] >=dev-python/tqdm-4.66.2[${PYTHON_USEDEP}] ') )" +PATCHES=( + # migrate from pytest-lazy-fixture to pytest-lazy-fixtures + "${FILESDIR}/${P}-lazy-fixtures.patch" +) + # These tests seem to require some b2 authentication (they're integration tests # so this is not unreasonable) EPYTEST_DESELECT=( diff --git a/dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch b/dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch new file mode 100644 index 0000000000..0a94287843 --- /dev/null +++ b/dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch @@ -0,0 +1,56 @@ +Migrate from pytest-lazy-fixture to pytest-lazy-fixtures. +https://github.com/Backblaze/b2-sdk-python/issues/484 +--- a/test/unit/account_info/fixtures.py ++++ b/test/unit/account_info/fixtures.py +@@ -11,6 +11,7 @@ from __future__ import annotations + + import pytest + from apiver_deps import InMemoryAccountInfo, SqliteAccountInfo ++from pytest_lazy_fixtures import lf + + + @pytest.fixture +@@ -84,8 +85,8 @@ def sqlite_account_info(sqlite_account_info_factory): + + @pytest.fixture( + params=[ +- pytest.lazy_fixture('in_memory_account_info_factory'), +- pytest.lazy_fixture('sqlite_account_info_factory'), ++ lf('in_memory_account_info_factory'), ++ lf('sqlite_account_info_factory'), + ] + ) + def account_info_factory(request): +@@ -94,8 +95,8 @@ def account_info_factory(request): + + @pytest.fixture( + params=[ +- pytest.lazy_fixture('in_memory_account_info'), +- pytest.lazy_fixture('sqlite_account_info'), ++ lf('in_memory_account_info'), ++ lf('sqlite_account_info'), + ] + ) + def account_info(request): +--- a/test/unit/test_cache.py ++++ b/test/unit/test_cache.py +@@ -13,7 +13,7 @@ from dataclasses import dataclass + + import pytest + from apiver_deps import AuthInfoCache, DummyCache, InMemoryAccountInfo, InMemoryCache +-from pytest_lazyfixture import lazy_fixture ++from pytest_lazy_fixtures import lf + + + @pytest.fixture +@@ -32,8 +32,8 @@ def auth_info_cache(): + + + @pytest.fixture( +- scope="class", params=[lazy_fixture('in_memory_cache'), +- lazy_fixture('auth_info_cache')] ++ params=[lf('in_memory_cache'), ++ lf('auth_info_cache')] + ) + def cache(request): + return request.param