Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-lazy-fixture for 
openSUSE:Factory checked in at 2024-06-21 16:02:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-lazy-fixture (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-lazy-fixture.new.18349 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-lazy-fixture"

Fri Jun 21 16:02:40 2024 rev:6 rq:1172298 version:0.6.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-lazy-fixture/python-pytest-lazy-fixture.changes
    2023-04-25 16:53:32.598228643 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-lazy-fixture.new.18349/python-pytest-lazy-fixture.changes
 2024-06-21 16:02:51.693308640 +0200
@@ -1,0 +2,9 @@
+Mon May  6 05:59:39 UTC 2024 - Steve Kowalik <[email protected]>
+
+- Switch to autosetup and pyproject macros.
+- Add numpy to BuildRequires, needed for the testsuite.
+- No more greedy globs in %files.
+- Add patch support-pytest-8.patch:
+  * Support pytest >= 8 changes.
+
+-------------------------------------------------------------------

New:
----
  support-pytest-8.patch

BETA DEBUG BEGIN:
  New:- No more greedy globs in %files.
- Add patch support-pytest-8.patch:
  * Support pytest >= 8 changes.
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-lazy-fixture.spec ++++++
--- /var/tmp/diff_new_pack.x3OV31/_old  2024-06-21 16:02:52.205327421 +0200
+++ /var/tmp/diff_new_pack.x3OV31/_new  2024-06-21 16:02:52.209327568 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pytest-lazy-fixture
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %{?sle15_python_module_pythons}
 Name:           python-pytest-lazy-fixture
 Version:        0.6.3
@@ -25,11 +24,16 @@
 License:        MIT
 URL:            https://github.com/tvorog/pytest-lazy-fixture
 Source:         
https://files.pythonhosted.org/packages/source/p/pytest-lazy-fixture/pytest-lazy-fixture-%{version}.tar.gz
-BuildRequires:  %{python_module pytest >= 3.2.5}
+# PATCH-FIX-UPSTREAM (ish) Sourced from gh#TvoroG/pytest-lazy-fixture/issues/65
+Patch0:         support-pytest-8.patch
+BuildRequires:  %{python_module numpy}
+BuildRequires:  %{python_module pip}
+BuildRequires:  %{python_module pytest >= 8.0}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-pytest >= 3.2.5
+Requires:       python-pytest >= 8.0
 BuildArch:      noarch
 %python_subpackages
 
@@ -37,13 +41,13 @@
 Helper to use fixtures in pytest.mark.parametrize.
 
 %prep
-%setup -q -n pytest-lazy-fixture-%{version}
+%autosetup -p1 -n pytest-lazy-fixture-%{version}
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
@@ -52,5 +56,7 @@
 %files %{python_files}
 %license LICENSE
 %doc README.rst
-%{python_sitelib}/*
+%{python_sitelib}/pytest_lazyfixture.py
+%pycache_only %{python_sitelib}/__pycache__/pytest_lazyfixture*.pyc
+%{python_sitelib}/pytest_lazy_fixture-%{version}.dist-info
 

++++++ support-pytest-8.patch ++++++
diff --git a/pytest_lazyfixture.py b/pytest_lazyfixture.py
index abf5db5..df83ce7 100644
--- a/pytest_lazyfixture.py
+++ b/pytest_lazyfixture.py
@@ -71,14 +71,13 @@ def pytest_make_parametrize_id(config, val, argname):
 def pytest_generate_tests(metafunc):
     yield
 
-    normalize_metafunc_calls(metafunc, 'funcargs')
-    normalize_metafunc_calls(metafunc, 'params')
+    normalize_metafunc_calls(metafunc)
 
 
-def normalize_metafunc_calls(metafunc, valtype, used_keys=None):
+def normalize_metafunc_calls(metafunc, used_keys=None):
     newcalls = []
     for callspec in metafunc._calls:
-        calls = normalize_call(callspec, metafunc, valtype, used_keys)
+        calls = normalize_call(callspec, metafunc, used_keys)
         newcalls.extend(calls)
     metafunc._calls = newcalls
 
@@ -98,17 +97,21 @@ def copy_metafunc(metafunc):
     return copied
 
 
-def normalize_call(callspec, metafunc, valtype, used_keys):
+def normalize_call(callspec, metafunc, used_keys):
     fm = metafunc.config.pluginmanager.get_plugin('funcmanage')
 
     used_keys = used_keys or set()
-    valtype_keys = set(getattr(callspec, valtype).keys()) - used_keys
+    keys = set(callspec.params.keys()) - used_keys
+    print(used_keys, keys)
 
-    for arg in valtype_keys:
-        val = getattr(callspec, valtype)[arg]
+    for arg in keys:
+        val = callspec.params[arg]
         if is_lazy_fixture(val):
             try:
-                _, fixturenames_closure, arg2fixturedefs = 
fm.getfixtureclosure([val.name], metafunc.definition.parent)
+                if pytest.version_tuple >= (8, 0, 0):
+                    fixturenames_closure, arg2fixturedefs = 
fm.getfixtureclosure(metafunc.definition.parent, [val.name], {})
+                else:
+                    _, fixturenames_closure, arg2fixturedefs = 
fm.getfixtureclosure([val.name], metafunc.definition.parent)
             except ValueError:
                 # 3.6.0 <= pytest < 3.7.0; `FixtureManager.getfixtureclosure` 
returns 2 values
                 fixturenames_closure, arg2fixturedefs = 
fm.getfixtureclosure([val.name], metafunc.definition.parent)
@@ -117,14 +120,14 @@ def normalize_call(callspec, metafunc, valtype, 
used_keys):
                 fixturenames_closure, arg2fixturedefs = 
fm.getfixtureclosure([val.name], current_node)
 
             extra_fixturenames = [fname for fname in fixturenames_closure
-                                  if fname not in callspec.params and fname 
not in callspec.funcargs]
+                                  if fname not in callspec.params]# and fname 
not in callspec.funcargs]
 
             newmetafunc = copy_metafunc(metafunc)
             newmetafunc.fixturenames = extra_fixturenames
             newmetafunc._arg2fixturedefs.update(arg2fixturedefs)
             newmetafunc._calls = [callspec]
             fm.pytest_generate_tests(newmetafunc)
-            normalize_metafunc_calls(newmetafunc, valtype, used_keys | 
set([arg]))
+            normalize_metafunc_calls(newmetafunc, used_keys | set([arg]))
             return newmetafunc._calls
 
         used_keys.add(arg)

Reply via email to