Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-examples for 
openSUSE:Factory checked in at 2025-08-27 21:33:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-examples (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-examples.new.30751 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-examples"

Wed Aug 27 21:33:47 2025 rev:12 rq:1301382 version:0.0.18

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-examples/python-pytest-examples.changes
    2025-08-18 16:08:16.098965669 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-examples.new.30751/python-pytest-examples.changes
 2025-08-27 21:34:28.022150273 +0200
@@ -1,0 +2,5 @@
+Wed Aug 20 08:20:40 UTC 2025 - Markéta Machová <mmach...@suse.com>
+
+- Instead of skipping the tests, add upstream ruff.patch
+
+-------------------------------------------------------------------

New:
----
  ruff.patch

----------(New B)----------
  New:
- Instead of skipping the tests, add upstream ruff.patch
----------(New E)----------

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

Other differences:
------------------
++++++ python-pytest-examples.spec ++++++
--- /var/tmp/diff_new_pack.AVKuEy/_old  2025-08-27 21:34:28.558172684 +0200
+++ /var/tmp/diff_new_pack.AVKuEy/_new  2025-08-27 21:34:28.558172684 +0200
@@ -24,6 +24,8 @@
 License:        MIT
 URL:            https://github.com/pydantic/pytest-examples
 Source:         
https://files.pythonhosted.org/packages/source/p/pytest-examples/pytest_examples-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM https://github.com/pydantic/pytest-examples/pull/65 Bump 
Ruff to 0.12.9, update regexes for new output rendering
+Patch0:         ruff.patch
 BuildRequires:  %{python_module black}
 BuildRequires:  %{python_module hatchling}
 BuildRequires:  %{python_module pip}
@@ -58,8 +60,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-# ruff slightly changed its error output formatting 
https://github.com/astral-sh/ruff/issues/19966
-%pytest -k 'not (test_run_example_ok_fail or test_ruff_offset or 
test_ruff_error)'
+%pytest -k 'not test_run_example_ok_fail'
 
 %files %{python_files}
 %license LICENSE

++++++ ruff.patch ++++++
>From 60ae70d05ee345b38c2d2048d36b4a4545c98b6b Mon Sep 17 00:00:00 2001
From: Brent Westbrook <brentrwestbr...@gmail.com>
Date: Mon, 18 Aug 2025 13:36:21 -0400
Subject: [PATCH] Bump Ruff to 0.12.9, update regexes for new output rendering

Ruff 0.12.9 updated our default `full` output rendering to split the
header (`filename:line:column error`) over two lines, which was causing a few
test failures. This PR bumps the Ruff dependency to `>=0.12.9` and updates the
regular expressions affecting the failing tests to expect the new format.

See https://github.com/astral-sh/ruff/issues/19966 for more details.
---
 pyproject.toml             |  2 +-
 pytest_examples/lint.py    |  4 ++--
 tests/test_lint.py         |  4 ++--
 tests/test_run_examples.py |  4 ++--
 uv.lock                    | 43 +++++++++++++++++++-------------------
 5 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index d630714..168de4f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -34,7 +34,7 @@ classifiers = [
     "Topic :: Software Development :: Libraries :: Python Modules",
 ]
 requires-python = ">=3.8"
-dependencies = ["pytest>=7", "black>=23", "ruff>=0.5.0"]
+dependencies = ["pytest>=7", "black>=23", "ruff>=0.12.9"]
 
 [project.entry-points.pytest11]
 examples = "pytest_examples"
diff --git a/pytest_examples/lint.py b/pytest_examples/lint.py
index 67133d4..17b6cb4 100644
--- a/pytest_examples/lint.py
+++ b/pytest_examples/lint.py
@@ -57,9 +57,9 @@ def ruff_check(
 
         def replace_offset(m: re.Match[str]):
             line_number = int(m.group(1))
-            return f'{example.path}:{line_number + example.start_line}'
+            return f' --> {example.path}:{line_number + example.start_line}'
 
-        output = re.sub(r'^-:(\d+)', replace_offset, stdout, flags=re.M)
+        output = re.sub(r'^ --> -:(\d+)', replace_offset, stdout, flags=re.M)
         raise FormatError(f'ruff failed:\n{indent(output, "  ")}')
     elif p.returncode != 0:
         raise RuntimeError(f'Error running ruff, return code 
{p.returncode}:\n{stderr or stdout}')
diff --git a/tests/test_lint.py b/tests/test_lint.py
index b735bb1..cfc67ed 100644
--- a/tests/test_lint.py
+++ b/tests/test_lint.py
@@ -24,11 +24,11 @@ def test_ruff_config():
 def test_ruff_offset():
     code = 'print(x)\n'
     example = CodeExample.create(code)
-    with pytest.raises(FormatError, match='testing.md:1:7: F821 Undefined 
name'):
+    with pytest.raises(FormatError, match='F821 Undefined name `x`\n   --> 
testing.md:1:7'):
         ruff_check(example, ExamplesConfig())
 
     example = CodeExample.create(code, start_line=10)
-    with pytest.raises(FormatError, match='testing.md:11:7: F821 Undefined 
name'):
+    with pytest.raises(FormatError, match='F821 Undefined name `x`\n   --> 
testing.md:11:7'):
         ruff_check(example, ExamplesConfig())
 
 
diff --git a/tests/test_run_examples.py b/tests/test_run_examples.py
index d9df4b2..53958cc 100644
--- a/tests/test_run_examples.py
+++ b/tests/test_run_examples.py
@@ -111,8 +111,8 @@ def test_find_run_examples(example: CodeExample, 
eval_example: EvalExample):
         '=== FAILURES ===\n',
         '___ test_find_run_examples[my_file.md:1-4] ___\n',
         'ruff failed:\n',
-        '  my_file.md:2:8: F401 [*] `sys` imported but unused\n',
-        '  my_file.md:3:7: F821 Undefined name `missing`\n',
+        '  F401 [*] `sys` imported but unused\n   --> my_file.md:2:8\n',
+        '  F821 Undefined name `missing`\n   --> my_file.md:3:7\n',
         '  Found 2 errors.\n',
         '  [*] 1 fixable with the `--fix` option.\n',
         '=== short test summary info ===\n',

Reply via email to