Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-mashumaro for
openSUSE:Factory checked in at 2026-02-10 21:13:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mashumaro (Old)
and /work/SRC/openSUSE:Factory/.python-mashumaro.new.1670 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mashumaro"
Tue Feb 10 21:13:31 2026 rev:8 rq:1332275 version:3.20
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mashumaro/python-mashumaro.changes
2026-02-05 18:05:51.129329167 +0100
+++
/work/SRC/openSUSE:Factory/.python-mashumaro.new.1670/python-mashumaro.changes
2026-02-10 21:14:37.513100854 +0100
@@ -1,0 +2,7 @@
+Tue Feb 10 05:52:15 UTC 2026 - Johannes Kastl
<[email protected]>
+
+- update to 3.20:
+ * Fixed type name for for PEP 695 types created with type keyword
+ (#301)
+
+-------------------------------------------------------------------
Old:
----
mashumaro-3.19.tar.gz
New:
----
mashumaro-3.20.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-mashumaro.spec ++++++
--- /var/tmp/diff_new_pack.sF6X9D/_old 2026-02-10 21:14:38.161128007 +0100
+++ /var/tmp/diff_new_pack.sF6X9D/_new 2026-02-10 21:14:38.165128175 +0100
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-mashumaro
-Version: 3.19
+Version: 3.20
Release: 0
Summary: Fast and well tested serialization library
License: Apache-2.0
++++++ mashumaro-3.19.tar.gz -> mashumaro-3.20.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/mashumaro-3.19/mashumaro/core/meta/helpers.py
new/mashumaro-3.20/mashumaro/core/meta/helpers.py
--- old/mashumaro-3.19/mashumaro/core/meta/helpers.py 2026-02-03
20:07:21.000000000 +0100
+++ new/mashumaro-3.20/mashumaro/core/meta/helpers.py 2026-02-09
22:32:55.000000000 +0100
@@ -129,6 +129,7 @@
limit: Optional[int] = None,
none_type_as_none: bool = False,
sep: str = ", ",
+ _type_alias_guard: Optional[set[int]] = None,
) -> str:
if typ == Tuple[()]:
return "()"
@@ -143,6 +144,7 @@
short=short,
resolved_type_params=resolved_type_params,
none_type_as_none=none_type_as_none,
+ _type_alias_guard=_type_alias_guard,
)
)
if len(to_join) > 1:
@@ -184,14 +186,17 @@
def type_name(
- typ: Optional[Type],
+ typ: Union[Type, Any],
short: bool = False,
resolved_type_params: Optional[dict[Type, Type]] = None,
is_type_origin: bool = False,
none_type_as_none: bool = False,
+ _type_alias_guard: Optional[set[int]] = None,
) -> str:
if resolved_type_params is None:
resolved_type_params = {}
+ if _type_alias_guard is None:
+ _type_alias_guard = set()
if typ is None:
return "None"
elif typ is NoneType and none_type_as_none:
@@ -205,15 +210,25 @@
typ=not_none_type_arg(get_args(typ), resolved_type_params),
short=short,
resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
)
return f"{_typing_name('Optional', short)}[{args_str}]"
elif is_union(typ):
args_str = _get_args_str(
- typ, short, resolved_type_params, none_type_as_none=True
+ typ=typ,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ none_type_as_none=True,
+ _type_alias_guard=_type_alias_guard,
)
return f"{_typing_name('Union', short)}[{args_str}]"
elif is_annotated(typ):
- return type_name(get_args(typ)[0], short, resolved_type_params)
+ return type_name(
+ typ=get_args(typ)[0],
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
+ )
elif not is_type_origin and is_literal(typ):
args_str = _get_literal_values_str(typ, short)
return f"{_typing_name('Literal', short, typ.__module__)}[{args_str}]"
@@ -223,7 +238,10 @@
and resolved_type_params[typ] is not typ
):
return type_name(
- resolved_type_params[typ], short, resolved_type_params
+ typ=resolved_type_params[typ],
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
)
else:
unpacked_type_arg = get_args(typ)[0]
@@ -231,10 +249,16 @@
unpacked_type_arg
) and not is_type_var_tuple(unpacked_type_arg):
return _get_args_str(
- unpacked_type_arg, short, resolved_type_params
+ typ=unpacked_type_arg,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
)
unpacked_type_name = type_name(
- unpacked_type_arg, short, resolved_type_params
+ typ=unpacked_type_arg,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
)
if PY_311_MIN:
return f"*{unpacked_type_name}"
@@ -242,7 +266,12 @@
_unpack = _typing_name("Unpack", short, typ.__module__)
return f"{_unpack}[{unpacked_type_name}]"
elif not is_type_origin and is_generic(typ):
- args_str = _get_args_str(typ, short, resolved_type_params)
+ args_str = _get_args_str(
+ typ=typ,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
+ )
if not args_str:
return get_generic_name(typ, short)
else:
@@ -255,14 +284,23 @@
and resolved_type_params[typ] is not typ
):
return type_name(
- resolved_type_params[typ], short, resolved_type_params
+ typ=resolved_type_params[typ],
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
)
elif is_type_var_any(typ):
return _typing_name("Any", short)
constraints = getattr(typ, "__constraints__")
if constraints:
args_str = ", ".join(
- type_name(c, short, resolved_type_params) for c in constraints
+ type_name(
+ typ=c,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
+ )
+ for c in constraints
)
return f"{_typing_name('Union', short)}[{args_str}]"
else:
@@ -270,10 +308,31 @@
bound = get_type_var_default(typ)
else:
bound = getattr(typ, "__bound__")
- return type_name(bound, short, resolved_type_params)
+ return type_name(
+ typ=bound,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ _type_alias_guard=_type_alias_guard,
+ )
elif is_new_type(typ) and not PY_310_MIN:
# because __qualname__ and __module__ are messed up
typ = typ.__supertype__
+ if is_type_alias_type(typ):
+ alias_id = id(typ)
+ if alias_id in _type_alias_guard:
+ return typ.__name__
+ _type_alias_guard.add(alias_id)
+ try:
+ return type_name(
+ typ=typ.__value__,
+ short=short,
+ resolved_type_params=resolved_type_params,
+ is_type_origin=is_type_origin,
+ none_type_as_none=none_type_as_none,
+ _type_alias_guard=_type_alias_guard,
+ )
+ finally:
+ _type_alias_guard.discard(alias_id)
try:
if short:
return typ.__qualname__ # type: ignore
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/mashumaro-3.19/pyproject.toml
new/mashumaro-3.20/pyproject.toml
--- old/mashumaro-3.19/pyproject.toml 2026-02-03 20:07:21.000000000 +0100
+++ new/mashumaro-3.20/pyproject.toml 2026-02-09 22:32:55.000000000 +0100
@@ -4,7 +4,7 @@
[project]
name = "mashumaro"
-version = "3.19"
+version = "3.20"
license = "Apache-2.0"
description = "Fast and well tested serialization library"
readme = "README.md"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/mashumaro-3.19/tests/conftest.py
new/mashumaro-3.20/tests/conftest.py
--- old/mashumaro-3.19/tests/conftest.py 2026-02-03 20:07:21.000000000
+0100
+++ new/mashumaro-3.20/tests/conftest.py 2026-02-09 22:32:55.000000000
+0100
@@ -8,6 +8,7 @@
"test_pep_695.py",
"test_recursive_union.py",
"test_jsonschema/test_jsonschema_pep_695.py",
+ "test_type_alias_type_name.py",
]
add_unpack_method = patch(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/mashumaro-3.19/tests/test_type_alias_type_name.py
new/mashumaro-3.20/tests/test_type_alias_type_name.py
--- old/mashumaro-3.19/tests/test_type_alias_type_name.py 1970-01-01
01:00:00.000000000 +0100
+++ new/mashumaro-3.20/tests/test_type_alias_type_name.py 2026-02-09
22:32:55.000000000 +0100
@@ -0,0 +1,20 @@
+import pytest
+
+from mashumaro.core.meta.helpers import type_name
+
+type JSON = str | int | float | bool | dict[str, JSON] | list[JSON] | None
+type A = int | list[B]
+type B = str | list[A]
+
+
+def test_type_name_recursive_type_alias_does_not_recurse_forever() -> None:
+ # Must not raise RecursionError
+ s = type_name(JSON, short=True)
+ assert "JSON" in s
+
+
+def test_type_name_mutual_recursive_type_aliases_does_not_recurse_forever() ->
(
+ None
+):
+ s = type_name(A, short=True)
+ assert "A" in s