Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-immutabledict for
openSUSE:Factory checked in at 2023-12-17 21:33:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-immutabledict (Old)
and /work/SRC/openSUSE:Factory/.python-immutabledict.new.25432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-immutabledict"
Sun Dec 17 21:33:01 2023 rev:5 rq:1133665 version:4.1.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-immutabledict/python-immutabledict.changes
2023-12-08 22:32:39.381330942 +0100
+++
/work/SRC/openSUSE:Factory/.python-immutabledict.new.25432/python-immutabledict.changes
2023-12-17 21:35:16.408012481 +0100
@@ -1,0 +2,6 @@
+Sat Dec 16 21:09:56 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 4.1.0:
+ * Do not store cached hash value when pickling
+
+-------------------------------------------------------------------
Old:
----
immutabledict-4.0.0.tar.gz
New:
----
immutabledict-4.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-immutabledict.spec ++++++
--- /var/tmp/diff_new_pack.YkQosK/_old 2023-12-17 21:35:16.836028032 +0100
+++ /var/tmp/diff_new_pack.YkQosK/_new 2023-12-17 21:35:16.836028032 +0100
@@ -27,7 +27,7 @@
%define short_name immutabledict
%{?sle15_python_module_pythons}
Name: python-%{short_name}%{psuffix}
-Version: 4.0.0
+Version: 4.1.0
Release: 0
Summary: Immutable wrapper around dictionaries (a fork of frozendict)
License: MIT
++++++ immutabledict-4.0.0.tar.gz -> immutabledict-4.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/immutabledict-4.0.0/PKG-INFO
new/immutabledict-4.1.0/PKG-INFO
--- old/immutabledict-4.0.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/immutabledict-4.1.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: immutabledict
-Version: 4.0.0
+Version: 4.1.0
Summary: Immutable wrapper around dictionaries (a fork of frozendict)
Home-page: https://github.com/corenting/immutabledict
License: MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/immutabledict-4.0.0/immutabledict/__init__.py
new/immutabledict-4.1.0/immutabledict/__init__.py
--- old/immutabledict-4.0.0/immutabledict/__init__.py 2023-11-25
13:34:07.496336700 +0100
+++ new/immutabledict-4.1.0/immutabledict/__init__.py 2023-12-16
11:42:09.917736800 +0100
@@ -11,12 +11,13 @@
KeysView,
Mapping,
Optional,
+ Tuple,
Type,
TypeVar,
ValuesView,
)
-__version__ = "4.0.0"
+__version__ = "4.1.0"
_K = TypeVar("_K")
_V = TypeVar("_V", covariant=True)
@@ -45,6 +46,11 @@
setattr(inst, "_hash", None)
return inst
+ def __reduce__(self) -> Tuple[Any, ...]:
+ # Do not store the cached hash value when pickling
+ # as the value might change across Python invocations.
+ return (self.__class__, (self._dict,))
+
def __getitem__(self, key: _K) -> _V:
return self._dict[key]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/immutabledict-4.0.0/pyproject.toml
new/immutabledict-4.1.0/pyproject.toml
--- old/immutabledict-4.0.0/pyproject.toml 2023-11-25 13:34:07.496336700
+0100
+++ new/immutabledict-4.1.0/pyproject.toml 2023-12-16 11:42:09.917736800
+0100
@@ -1,6 +1,6 @@
[tool.poetry]
name = "immutabledict"
-version = "4.0.0"
+version = "4.1.0"
description = "Immutable wrapper around dictionaries (a fork of frozendict)"
authors = ["Corentin Garcia <[email protected]>"]
license = "MIT"
@@ -25,9 +25,9 @@
python = "^3.8"
[tool.poetry.dev-dependencies]
-black = "*"
coverage = "*"
mypy = "*"
+myst-parser = { version = "^2.0.0", python = "^3.9" }
pytest = "*"
pytest-cov = "*"
ruff = "*"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/immutabledict-4.0.0/tests/test_immutabledict.py
new/immutabledict-4.1.0/tests/test_immutabledict.py
--- old/immutabledict-4.0.0/tests/test_immutabledict.py 2023-11-25
13:34:07.496336700 +0100
+++ new/immutabledict-4.1.0/tests/test_immutabledict.py 2023-12-16
11:42:09.917736800 +0100
@@ -1,3 +1,5 @@
+import pickle
+from io import BytesIO
from typing import Any, Dict, Union
import pytest
@@ -213,7 +215,7 @@
setup="s=0; d = immutabledict({i:i for i in range(1000000)})",
)
- assert time_immutable < 1.2 * time_standard
+ assert time_immutable < 1.4 * time_standard
def test_set_delete_update(self) -> None:
d: immutabledict[str, int] = immutabledict(a=1, b=2)
@@ -237,6 +239,23 @@
immutable_dict: immutabledict[str, int] = immutabledict(a=1, b=2)
assert immutable_dict == {"a": 1, "b": 2} == dict(a=1, b=2)
+ def test_reduce(self) -> None:
+ my_dict: immutabledict[str, int] = immutabledict(a=1, b=2)
+ reduce_cls, reduce_args = my_dict.__reduce__()
+
+ assert reduce_cls == immutabledict
+ assert reduce_args == (my_dict._dict,)
+
+ def test_pickle(self) -> None:
+ my_dict: immutabledict[str, int] = immutabledict(a=1, b=2)
+ bytes_io = BytesIO()
+ pickle.dump(my_dict, bytes_io)
+ bytes_io.seek(0)
+
+ from_pickle_dict = pickle.loads(bytes_io.getvalue()) # noqa: S301
+
+ assert my_dict == from_pickle_dict
+
class TestImmutableOrderedDict:
def test_ordered(self) -> None: