Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-itemadapter for 
openSUSE:Factory checked in at 2026-08-01 18:31:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-itemadapter (Old)
 and      /work/SRC/openSUSE:Factory/.python-itemadapter.new.16738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-itemadapter"

Sat Aug  1 18:31:40 2026 rev:10 rq:1368712 version:0.13.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-itemadapter/python-itemadapter.changes    
2026-04-11 22:31:45.117587561 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-itemadapter.new.16738/python-itemadapter.changes
 2026-08-01 18:34:43.430970702 +0200
@@ -1,0 +2,6 @@
+Fri Jul 31 01:57:53 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Add patch support-scrapy-2.17.patch:
+  * Support Scrapy 2.17 unsorted fields.
+
+-------------------------------------------------------------------

New:
----
  support-scrapy-2.17.patch

----------(New B)----------
  New:
- Add patch support-scrapy-2.17.patch:
  * Support Scrapy 2.17 unsorted fields.
----------(New E)----------

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

Other differences:
------------------
++++++ python-itemadapter.spec ++++++
--- /var/tmp/diff_new_pack.u9gy45/_old  2026-08-01 18:34:46.075061734 +0200
+++ /var/tmp/diff_new_pack.u9gy45/_new  2026-08-01 18:34:46.083062010 +0200
@@ -35,9 +35,10 @@
 Source:         
https://github.com/scrapy/itemadapter/archive/v%{version}.tar.gz#/itemadapter-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM: 
https://github.com/scrapy/itemadapter/commit/e2a28fcfa2b63a596cf26c0eae1a6f04235b348c
 Patch1:         fix-pydantic-tests.patch
+# PATCH-FIX-UPSTREAM gh#scrapy/itemadapter#119
+Patch2:         support-scrapy-2.17.patch
 BuildRequires:  %{python_module hatchling}
 BuildRequires:  %{python_module pip}
-BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 %if %{with test}

++++++ support-scrapy-2.17.patch ++++++
>From 0619cf077556c30bf513e2c62f19469556c081a9 Mon Sep 17 00:00:00 2001
From: Andrey Rakhmatullin <[email protected]>
Date: Sun, 12 Jul 2026 15:27:21 +0500
Subject: [PATCH] Support Scrapy 2.17 unsorted fields.

---
 pyproject.toml        |  2 ++
 tests/test_adapter.py | 72 +++++++++++++++++++++++--------------------
 2 files changed, 40 insertions(+), 34 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index d1b24af..363a79f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -253,6 +253,8 @@ ignore = [
     "RUF012",
     # Use of `assert` detected
     "S101",
+    # Yoda condition detected
+    "SIM300",
 ]
 
 [tool.ruff.lint.isort]
diff --git a/tests/test_adapter.py b/tests/test_adapter.py
index 38130fc..734e40c 100644
--- a/tests/test_adapter.py
+++ b/tests/test_adapter.py
@@ -5,6 +5,7 @@
 from types import MappingProxyType
 
 import pytest
+from packaging.version import Version
 
 from itemadapter.adapter import ItemAdapter, PydanticAdapter
 from tests import (
@@ -38,6 +39,13 @@
 )
 from tests.test_json_schema import check_schemas
 
+try:
+    import scrapy
+
+    SCRAPY_VERSION = Version(scrapy.__version__)
+except ImportError:
+    SCRAPY_VERSION = None
+
 
 class ItemAdapterReprTestCase(unittest.TestCase):
     def test_repr_dict(self):
@@ -338,6 +346,35 @@ def test_field_names_from_class(self):
     },
 }
 
+_SCRAPY_JSON_SCHEMA_PROPERTIES = {
+    **NonDictTestMixin.expected_json_schema["properties"],
+    # Title is set through json_schema_extra, so it comes first.
+    "name": {"title": "Name", "type": "string", "description": "Display name"},
+    "nested": _SCRAPY_NESTED_JSON_SCHEMA,
+    "nested_list": {
+        "type": "array",
+        "items": _SCRAPY_NESTED_JSON_SCHEMA,
+    },
+    "nested_dict": {
+        "type": "object",
+        "additionalProperties": _SCRAPY_NESTED_JSON_SCHEMA,
+    },
+    "nested_dict_list": {
+        "type": "array",
+        "items": {
+            "type": "object",
+            "additionalProperties": _SCRAPY_NESTED_JSON_SCHEMA,
+        },
+    },
+    # No type, since none was specified in json_schema_extra.
+    "produced": {},
+}
+
+if SCRAPY_VERSION is not None and SCRAPY_VERSION < Version("2.17"):
+    # Scrapy < 2.17 sorts item fields alphabetically.
+    # https://github.com/scrapy/scrapy/issues/7015
+    _SCRAPY_JSON_SCHEMA_PROPERTIES = 
dict(sorted(_SCRAPY_JSON_SCHEMA_PROPERTIES.items()))
+
 
 class ScrapySubclassedItemTestCase(NonDictTestMixin, unittest.TestCase):
     item_class = ScrapySubclassedItem
@@ -349,40 +386,7 @@ class ScrapySubclassedItemTestCase(NonDictTestMixin, 
unittest.TestCase):
         "llmHint": "Hi model!",
         "type": "object",
         "additionalProperties": False,
-        "properties": {
-            **{
-                k: NonDictTestMixin.expected_json_schema["properties"][k]
-                for k in 
sorted(NonDictTestMixin.expected_json_schema["properties"])
-            },
-            # Different order since stuff defined in json_schema_extra comes
-            # first.
-            "name": {
-                "title": "Name",
-                "type": "string",
-                "description": "Display name",
-            },
-            "nested": _SCRAPY_NESTED_JSON_SCHEMA,
-            "nested_list": {
-                "type": "array",
-                "items": _SCRAPY_NESTED_JSON_SCHEMA,
-            },
-            "nested_dict": {
-                "type": "object",
-                "additionalProperties": _SCRAPY_NESTED_JSON_SCHEMA,
-            },
-            "nested_dict_list": {
-                "type": "array",
-                "items": {
-                    "type": "object",
-                    "additionalProperties": _SCRAPY_NESTED_JSON_SCHEMA,
-                },
-            },
-            # No type, since none was specified in json_schema_extra.
-            "produced": {},
-            # value comes last due to Scrapy items sorting fields
-            # alphabetically. https://github.com/scrapy/scrapy/issues/7015
-            "value": 
NonDictTestMixin.expected_json_schema["properties"]["value"],
-        },
+        "properties": _SCRAPY_JSON_SCHEMA_PROPERTIES,
     }
 
     def test_get_value_keyerror_item_dict(self):

Reply via email to