Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-frozendict for openSUSE:Leap:16.0 checked in at 2025-07-03 13:12:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:16.0/python-frozendict (Old) and /work/SRC/openSUSE:Leap:16.0/.python-frozendict.new.1903 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-frozendict" Thu Jul 3 13:12:05 2025 rev:2 rq:1289633 version:2.4.6 Changes: -------- --- /work/SRC/openSUSE:Leap:16.0/python-frozendict/python-frozendict.changes 2025-03-19 11:55:30.143812705 +0100 +++ /work/SRC/openSUSE:Leap:16.0/.python-frozendict.new.1903/python-frozendict.changes 2025-07-03 13:12:22.196276063 +0200 @@ -1,0 +2,11 @@ +Tue Oct 29 21:35:22 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 2.4.6: + * Added pure py wheel for Python 3.13 + * Now `set`, `setdefault` and `delete` does always a shallow + copy, as the C extension, `tuple` and the rest of the world. +- update to 2.4.5: + * Improved speed of `set`, `setdefault` and `delete` for pure + py impl, if `frozendict` is hashable + +------------------------------------------------------------------- Old: ---- frozendict-2.4.4.tar.gz New: ---- frozendict-2.4.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-frozendict.spec ++++++ --- /var/tmp/diff_new_pack.M1mLvW/_old 2025-07-03 13:12:23.520331018 +0200 +++ /var/tmp/diff_new_pack.M1mLvW/_new 2025-07-03 13:12:23.532331516 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-frozendict -Version: 2.4.4 +Version: 2.4.6 Release: 0 Summary: An immutable dictionary License: MIT ++++++ frozendict-2.4.4.tar.gz -> frozendict-2.4.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/PKG-INFO new/frozendict-2.4.6/PKG-INFO --- old/frozendict-2.4.4/PKG-INFO 2024-05-06 21:32:35.955710600 +0200 +++ new/frozendict-2.4.6/PKG-INFO 2024-10-12 16:47:31.267452200 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: frozendict -Version: 2.4.4 +Version: 2.4.6 Summary: A simple immutable dictionary Home-page: https://github.com/Marco-Sulla/python-frozendict Author: Marco Sulla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict/__init__.py new/frozendict-2.4.6/src/frozendict/__init__.py --- old/frozendict-2.4.4/src/frozendict/__init__.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict/__init__.py 2024-10-12 16:47:27.000000000 +0200 @@ -2,7 +2,7 @@ Provides frozendict, a simple immutable dictionary. """ -try: +try: # pragma: no cover from ._frozendict import * c_ext = True # noinspection PyUnresolvedReferences @@ -14,21 +14,25 @@ from .version import version as __version__ from . import monkeypatch from .cool import * +from . import cool def _getFrozendictJsonEncoder(BaseJsonEncoder = None): - if BaseJsonEncoder is None: + if BaseJsonEncoder is None: # pragma: no cover from json.encoder import JSONEncoder BaseJsonEncoder = JSONEncoder class FrozendictJsonEncoderInternal(BaseJsonEncoder): def default(self, obj): - if isinstance(obj, frozendict): + if isinstance(obj, frozendict): # pragma: no cover # TODO create a C serializer return dict(obj) - return BaseJsonEncoder.default(self, obj) + return BaseJsonEncoder.default( + self, + obj + ) # pragma: no cover return FrozendictJsonEncoderInternal @@ -44,7 +48,7 @@ del Mapping -if c_ext: +if c_ext: # pragma: no cover __all__ = (frozendict.__name__, ) else: __all__ = _frozendict_py.__all__ @@ -55,5 +59,3 @@ __all__ += cool.__all__ __all__ += (FrozendictJsonEncoder.__name__, "FrozenOrderedDict") - -del cool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict/_frozendict_py.py new/frozendict-2.4.6/src/frozendict/_frozendict_py.py --- old/frozendict-2.4.4/src/frozendict/_frozendict_py.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict/_frozendict_py.py 2024-10-12 16:47:27.000000000 +0200 @@ -12,6 +12,7 @@ _empty_frozendict = None +_module_name = "frozendict" # noinspection PyPep8Naming @@ -104,7 +105,7 @@ klass = self.__class__ if klass == frozendict: - name = f"frozendict.{klass.__name__}" + name = f"{_module_name}.{klass.__name__}" else: name = klass.__name__ @@ -159,7 +160,7 @@ return (self.__class__, (dict(self),)) def set(self, key, val): - new_self = deepcopy(dict(self)) + new_self = dict(self) new_self[key] = val return self.__class__(new_self) @@ -168,14 +169,14 @@ if key in self: return self - new_self = deepcopy(dict(self)) + new_self = dict(self) new_self[key] = default return self.__class__(new_self) def delete(self, key): - new_self = deepcopy(dict(self)) + new_self = dict(self) del new_self[key] if new_self: @@ -235,7 +236,7 @@ try: # noinspection PyStatementEffect frozendict.__reversed__ -except AttributeError: +except AttributeError: # pragma: no cover def frozendict_reversed(self, *_args, **_kwargs): return reversed(tuple(self)) @@ -248,6 +249,6 @@ frozendict.update = immutable frozendict.__delattr__ = immutable frozendict.__setattr__ = immutable -frozendict.__module__ = 'frozendict' +frozendict.__module__ = _module_name __all__ = (frozendict.__name__,) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict/cool.py new/frozendict-2.4.6/src/frozendict/cool.py --- old/frozendict-2.4.4/src/frozendict/cool.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict/cool.py 2024-10-12 16:47:27.000000000 +0200 @@ -6,7 +6,8 @@ # fix for python 3.9- -if not issubclass(array, MutableSequence): +# coverage does not work here! +if not issubclass(array, MutableSequence): # pragma: no cover # noinspection PyUnresolvedReferences MutableSequence.register(array) @@ -301,7 +302,7 @@ except KeyError: if frozen_type: freeze = type_o - else: + else: # pragma: no cover raise return freeze(o_copy) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict/monkeypatch.py new/frozendict-2.4.6/src/frozendict/monkeypatch.py --- old/frozendict-2.4.4/src/frozendict/monkeypatch.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict/monkeypatch.py 2024-10-12 16:47:27.000000000 +0200 @@ -13,7 +13,7 @@ res = cool.c_ext if warn and res == warn_c: - if warn_c: + if warn_c: # pragma: no cover msg = "C Extension version, monkeypatch will be not applied" else: msg = "Pure Python version, monkeypatch will be not applied" @@ -25,7 +25,7 @@ return res -def patchOrUnpatchJson(*, patch, warn = True): +def patchOrUnpatchJson(*, patch, warn = True): # pragma: no cover if not checkCExtension(warn = warn): return @@ -78,7 +78,7 @@ json._default_encoder = default_json_encoder -def patchOrUnpatchOrjson(*, patch, warn = True): +def patchOrUnpatchOrjson(*, patch, warn = True): # pragma: no cover if not checkCExtension(warn = warn): return @@ -118,7 +118,11 @@ orjson.orjson.dumps = defaultOrjsonDumps -def patchOrUnpatchMutableMappingSubclasshook(*, patch, warn = True): +def patchOrUnpatchMutableMappingSubclasshook( + *, + patch, + warn = True +): # pragma: no cover warn_c = True if checkCExtension(warn = warn, warn_c = warn_c): @@ -185,10 +189,10 @@ try: import orjson - except ImportError: + except ImportError: # pragma: no cover if raise_orjson: raise - else: + else: # pragma: no cover patchOrUnpatchOrjson(patch = patch, warn = warn) patchOrUnpatchMutableMappingSubclasshook(patch = patch, warn = warn) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict/version.py new/frozendict-2.4.6/src/frozendict/version.py --- old/frozendict-2.4.4/src/frozendict/version.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict/version.py 2024-10-12 16:47:27.000000000 +0200 @@ -1 +1 @@ -version = "2.4.4" +version = "2.4.6" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict.egg-info/PKG-INFO new/frozendict-2.4.6/src/frozendict.egg-info/PKG-INFO --- old/frozendict-2.4.4/src/frozendict.egg-info/PKG-INFO 2024-05-06 21:32:35.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict.egg-info/PKG-INFO 2024-10-12 16:47:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: frozendict -Version: 2.4.4 +Version: 2.4.6 Summary: A simple immutable dictionary Home-page: https://github.com/Marco-Sulla/python-frozendict Author: Marco Sulla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/src/frozendict.egg-info/SOURCES.txt new/frozendict-2.4.6/src/frozendict.egg-info/SOURCES.txt --- old/frozendict-2.4.4/src/frozendict.egg-info/SOURCES.txt 2024-05-06 21:32:35.000000000 +0200 +++ new/frozendict-2.4.6/src/frozendict.egg-info/SOURCES.txt 2024-10-12 16:47:31.000000000 +0200 @@ -70,4 +70,5 @@ test/test_freeze.py test/test_frozendict.py test/test_frozendict_subclass.py +test/test_monkeypatch.py test/typed.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/test/test_freeze.py new/frozendict-2.4.6/test/test_freeze.py --- old/frozendict-2.4.4/test/test_freeze.py 2024-05-06 21:32:31.000000000 +0200 +++ new/frozendict-2.4.6/test/test_freeze.py 2024-10-12 16:47:27.000000000 +0200 @@ -2,7 +2,7 @@ import frozendict as cool from frozendict import frozendict from collections import OrderedDict -from collections.abc import MutableSequence, Sequence +from collections.abc import MutableSequence, Sequence, Iterable from array import array from types import MappingProxyType from frozendict import FreezeError, FreezeWarning @@ -14,6 +14,18 @@ self.x = x +class NoDictAndHash: + __slots__ = ( + "x", + ) + + def __init__(self, x): + self.x = x + + def __hash__(self): + raise TypeError() + + class BaseSeq(Sequence): def __init__(self, seq): @@ -65,6 +77,11 @@ @pytest.fixture +def no_cure_inverse(): + return (frozendict(a=frozendict({1: 2})), ) + + +@pytest.fixture def a(): a = A(3) @@ -72,6 +89,13 @@ @pytest.fixture +def no_dict_and_hash(): + res = NoDictAndHash(3) + + return res + + +@pytest.fixture def before_cure(a): return {"x": [ 5, @@ -170,7 +194,11 @@ ) == after_cure_inverse -def test_register_inverse(before_cure_inverse, after_cure_inverse): +def test_register_inverse( + before_cure_inverse, + after_cure_inverse, + no_cure_inverse, +): with pytest.warns(FreezeWarning): cool.register( frozendict, @@ -179,6 +207,10 @@ ) assert cool.deepfreeze(before_cure_inverse) == after_cure_inverse + + cool.unregister(frozendict, inverse=True) + + assert cool.deepfreeze(before_cure_inverse) == no_cure_inverse def test_prefer_forward(): @@ -205,3 +237,13 @@ def test_enum(my_enum): assert cool.deepfreeze(my_enum) is my_enum + + +def test_get_items(): + with pytest.raises(TypeError): + cool.cool.getItems(5) + + +def test_no_dict_and_hash(no_dict_and_hash): + with pytest.raises(TypeError): + cool.deepfreeze(no_dict_and_hash) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frozendict-2.4.4/test/test_monkeypatch.py new/frozendict-2.4.6/test/test_monkeypatch.py --- old/frozendict-2.4.4/test/test_monkeypatch.py 1970-01-01 01:00:00.000000000 +0100 +++ new/frozendict-2.4.6/test/test_monkeypatch.py 2024-10-12 16:47:27.000000000 +0200 @@ -0,0 +1,48 @@ +import json + +import frozendict as cool +import pytest +from frozendict import frozendict +from frozendict.monkeypatch import MonkeypatchWarning + + +class A: + pass + + +@pytest.fixture +def object_to_serialize(): + return frozendict() + + +@pytest.fixture +def object_to_serialize_2(): + return A() + + +@pytest.fixture +def serialized_object(): + return "{}" + + +def test_get_json_encoder( + object_to_serialize, + object_to_serialize_2, + serialized_object, +): + if cool.c_ext: + cool.monkeypatch.patchOrUnpatchJson(patch=True) + else: + with pytest.warns(MonkeypatchWarning): + cool.monkeypatch.patchOrUnpatchJson(patch=True, warn=True) + + assert json.dumps(object_to_serialize) == serialized_object + + with pytest.raises(TypeError): + json.dumps(object_to_serialize_2) + + cool.monkeypatch.patchOrUnpatchJson(patch=False, warn=False) + + if cool.c_ext: + with pytest.raises(TypeError): + json.dumps(object_to_serialize)