public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pydantic-extra-types] f43: Patch tests for Pydantic 3.13
Date: Mon, 17 Aug 2026 15:43:53 GMT [thread overview]
Message-ID: <178698143358.1.6332558387625988845.rpms-python-pydantic-extra-types-1900e23d197f@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-pydantic-extra-types
Branch : f43
Commit : 1900e23d197f75d961d50e75653254056a4aecfc
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date : 2026-05-13T20:01:32+01:00
Stats : +189/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-pydantic-extra-types/c/1900e23d197f75d961d50e75653254056a4aecfc?branch=f43
Log:
Patch tests for Pydantic 3.13
---
diff --git a/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch b/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
new file mode 100644
index 0000000..a8c5bdf
--- /dev/null
+++ b/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
@@ -0,0 +1,186 @@
+From 6f0217de5e26b99d09ffd9bb95da415779e6bef6 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Wed, 13 May 2026 16:45:47 +0100
+Subject: [PATCH] fix: Adjust tests for Pydantic 2.13 (#394)
+
+https://github.com/pydantic/pydantic/pull/12815 has the effect of adding
+a new `description` member to the `Coordinate` schema. Ignore it so
+that tests pass with both old and new versions.
+---
+ tests/test_coordinate.py | 85 +++++++++++++++++++++------------------
+ tests/test_json_schema.py | 41 ++++++++++---------
+ 2 files changed, 67 insertions(+), 59 deletions(-)
+
+diff --git a/tests/test_coordinate.py b/tests/test_coordinate.py
+index 99e9365e..74e515a6 100644
+--- a/tests/test_coordinate.py
++++ b/tests/test_coordinate.py
+@@ -3,6 +3,7 @@
+ from typing import Any, Optional, Union
+
+ import pytest
++from dirty_equals import IsPartialDict
+ from pydantic import BaseModel, ValidationError
+ from pydantic_core._pydantic_core import ArgsKwargs
+
+@@ -215,27 +216,29 @@ def test_json_schema():
+ class Model(BaseModel):
+ value: Coordinate
+
+- assert Model.model_json_schema(mode='validation')['$defs']['Coordinate'] == {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
+- },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
++ assert Model.model_json_schema(mode='validation')['$defs']['Coordinate'] == IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
+- },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
++ }
++ )
+ assert Model.model_json_schema(mode='validation')['properties']['value'] == {
+ 'anyOf': [
+ {'$ref': '#/$defs/Coordinate'},
+@@ -254,27 +257,29 @@ class Model(BaseModel):
+ }
+ assert Model.model_json_schema(mode='serialization') == {
+ '$defs': {
+- 'Coordinate': {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
++ 'Coordinate': IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
+- },
+- },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
++ }
++ )
+ },
+ 'properties': {'value': {'$ref': '#/$defs/Coordinate', 'title': 'Value'}},
+ 'required': ['value'],
+diff --git a/tests/test_json_schema.py b/tests/test_json_schema.py
+index 62748d3a..f82219b7 100644
+--- a/tests/test_json_schema.py
++++ b/tests/test_json_schema.py
+@@ -2,6 +2,7 @@
+
+ import pycountry
+ import pytest
++from dirty_equals import IsPartialDict
+ from pydantic import BaseModel
+
+ import pydantic_extra_types
+@@ -189,27 +190,29 @@
+ Coordinate,
+ {
+ '$defs': {
+- 'Coordinate': {
+- 'properties': {
+- 'latitude': {
+- 'anyOf': [
+- {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Latitude',
+- },
+- 'longitude': {
+- 'anyOf': [
+- {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
+- {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
+- ],
+- 'title': 'Longitude',
++ 'Coordinate': IsPartialDict(
++ {
++ 'properties': {
++ 'latitude': {
++ 'anyOf': [
++ {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Latitude',
++ },
++ 'longitude': {
++ 'anyOf': [
++ {'maximum': 180.0, 'minimum': -180.0, 'type': 'number'},
++ {'type': 'string', 'pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'},
++ ],
++ 'title': 'Longitude',
++ },
+ },
++ 'required': ['latitude', 'longitude'],
++ 'title': 'Coordinate',
++ 'type': 'object',
+ },
+- 'required': ['latitude', 'longitude'],
+- 'title': 'Coordinate',
+- 'type': 'object',
+- }
++ )
+ },
+ 'properties': {
+ 'x': {
diff --git a/python-pydantic-extra-types.spec b/python-pydantic-extra-types.spec
index 82744c4..7638c16 100644
--- a/python-pydantic-extra-types.spec
+++ b/python-pydantic-extra-types.spec
@@ -20,6 +20,9 @@ License: MIT
URL: %{forgeurl}
Source: %{forgesource}
+# fix: Adjust tests for Pydantic 2.13
+Patch: %{forgeurl}/commit/6f0217de5e26b99d09ffd9bb95da415779e6bef6.patch
+
BuildArch: noarch
BuildRequires: python3-devel
reply other threads:[~2026-08-17 15:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178698143358.1.6332558387625988845.rpms-python-pydantic-extra-types-1900e23d197f@fedoraproject.org \
--to=code@musicinmybrain.net \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox