Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-proto-plus for 
openSUSE:Factory checked in at 2026-02-23 16:12:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-proto-plus (Old)
 and      /work/SRC/openSUSE:Factory/.python-proto-plus.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-proto-plus"

Mon Feb 23 16:12:41 2026 rev:18 rq:1334408 version:1.27.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-proto-plus/python-proto-plus.changes      
2026-01-09 17:07:02.468826854 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-proto-plus.new.1977/python-proto-plus.changes
    2026-02-23 16:14:29.690146821 +0100
@@ -1,0 +2,6 @@
+Mon Feb 23 08:36:49 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 1.27.1:
+  * remove float_precision for protobuf 7
+
+-------------------------------------------------------------------

Old:
----
  proto_plus-1.27.0.tar.gz

New:
----
  proto_plus-1.27.1.tar.gz

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

Other differences:
------------------
++++++ python-proto-plus.spec ++++++
--- /var/tmp/diff_new_pack.IEZVb0/_old  2026-02-23 16:14:30.350173995 +0100
+++ /var/tmp/diff_new_pack.IEZVb0/_new  2026-02-23 16:14:30.350173995 +0100
@@ -27,7 +27,7 @@
 %define modname proto_plus
 %{?sle15_python_module_pythons}
 Name:           python-proto-plus%{psuffix}
-Version:        1.27.0
+Version:        1.27.1
 Release:        0
 Summary:        Pythonic Protocol Buffers
 License:        Apache-2.0

++++++ proto_plus-1.27.0.tar.gz -> proto_plus-1.27.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/PKG-INFO 
new/proto_plus-1.27.1/PKG-INFO
--- old/proto_plus-1.27.0/PKG-INFO      2025-12-16 14:43:05.975127500 +0100
+++ new/proto_plus-1.27.1/PKG-INFO      2026-02-02 18:31:08.810303200 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: proto-plus
-Version: 1.27.0
+Version: 1.27.1
 Summary: Beautiful, Pythonic protocol buffers
 Author-email: Google LLC <[email protected]>
 License: Apache 2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/proto/message.py 
new/proto_plus-1.27.1/proto/message.py
--- old/proto_plus-1.27.0/proto/message.py      2025-12-16 14:42:34.000000000 
+0100
+++ new/proto_plus-1.27.1/proto/message.py      2026-02-02 18:30:39.000000000 
+0100
@@ -36,6 +36,9 @@
 
 PROTOBUF_VERSION = google.protobuf.__version__
 
+# extract the major version code
+_PROTOBUF_MAJOR_VERSION = PROTOBUF_VERSION.partition(".")[0]
+
 _upb = has_upb()  # Important to cache result here.
 
 
@@ -383,7 +386,7 @@
             including_default_value_fields (Optional(bool)): The value of 
`including_default_value_fields` set by the user.
         """
         if (
-            PROTOBUF_VERSION[0] not in ("3", "4")
+            _PROTOBUF_MAJOR_VERSION not in ("3", "4")
             and including_default_value_fields is not None
         ):
             warnings.warn(
@@ -491,7 +494,7 @@
                 An indent level of 0 or negative will only insert newlines.
                 Pass None for the most compact representation without newlines.
             float_precision (Optional(int)): If set, use this to specify float 
field valid digits.
-                Default is None.
+                Default is None. [DEPRECATED] float_precision was removed in 
Protobuf 7.x.
             always_print_fields_with_no_presence (Optional(bool)): If True, 
fields without
                 presence (implicit presence scalars, repeated fields, and map 
fields) will
                 always be serialized. Any field that supports presence is not 
affected by
@@ -501,36 +504,7 @@
         Returns:
             str: The json string representation of the protocol buffer.
         """
-
-        print_fields = cls._normalize_print_fields_without_presence(
-            always_print_fields_with_no_presence, 
including_default_value_fields
-        )
-
-        if PROTOBUF_VERSION[0] in ("3", "4"):
-            return MessageToJson(
-                cls.pb(instance),
-                use_integers_for_enums=use_integers_for_enums,
-                including_default_value_fields=print_fields,
-                preserving_proto_field_name=preserving_proto_field_name,
-                sort_keys=sort_keys,
-                indent=indent,
-                float_precision=float_precision,
-            )
-        else:
-            # The `including_default_value_fields` argument was removed from 
protobuf 5.x
-            # and replaced with `always_print_fields_with_no_presence` which 
very similar but has
-            # handles optional fields consistently by not affecting them.
-            # The old flag accidentally had inconsistent behavior between 
proto2
-            # optional and proto3 optional fields.
-            return MessageToJson(
-                cls.pb(instance),
-                use_integers_for_enums=use_integers_for_enums,
-                always_print_fields_with_no_presence=print_fields,
-                preserving_proto_field_name=preserving_proto_field_name,
-                sort_keys=sort_keys,
-                indent=indent,
-                float_precision=float_precision,
-            )
+        return _message_to_map(map_fn=MessageToJson, **locals())
 
     def from_json(cls, payload, *, ignore_unknown_fields=False) -> "Message":
         """Given a json string representing an instance,
@@ -576,7 +550,7 @@
                 This value must match `always_print_fields_with_no_presence`,
                 if both arguments are explicitly set.
             float_precision (Optional(int)): If set, use this to specify float 
field valid digits.
-                Default is None.
+                Default is None. [DEPRECATED] float_precision was removed in 
Protobuf 7.x.
             always_print_fields_with_no_presence (Optional(bool)): If True, 
fields without
                 presence (implicit presence scalars, repeated fields, and map 
fields) will
                 always be serialized. Any field that supports presence is not 
affected by
@@ -588,32 +562,7 @@
                   Messages and map fields are represented as dicts,
                   repeated fields are represented as lists.
         """
-
-        print_fields = cls._normalize_print_fields_without_presence(
-            always_print_fields_with_no_presence, 
including_default_value_fields
-        )
-
-        if PROTOBUF_VERSION[0] in ("3", "4"):
-            return MessageToDict(
-                cls.pb(instance),
-                including_default_value_fields=print_fields,
-                preserving_proto_field_name=preserving_proto_field_name,
-                use_integers_for_enums=use_integers_for_enums,
-                float_precision=float_precision,
-            )
-        else:
-            # The `including_default_value_fields` argument was removed from 
protobuf 5.x
-            # and replaced with `always_print_fields_with_no_presence` which 
very similar but has
-            # handles optional fields consistently by not affecting them.
-            # The old flag accidentally had inconsistent behavior between 
proto2
-            # optional and proto3 optional fields.
-            return MessageToDict(
-                cls.pb(instance),
-                always_print_fields_with_no_presence=print_fields,
-                preserving_proto_field_name=preserving_proto_field_name,
-                use_integers_for_enums=use_integers_for_enums,
-                float_precision=float_precision,
-            )
+        return _message_to_map(map_fn=MessageToDict, **locals())
 
     def copy_from(cls, instance, other):
         """Equivalent for protobuf.Message.CopyFrom
@@ -966,4 +915,48 @@
         return self._pb
 
 
+def _message_to_map(
+    cls,
+    map_fn,
+    instance,
+    *,
+    including_default_value_fields=None,
+    always_print_fields_with_no_presence=None,
+    float_precision=None,
+    **kwargs,
+):
+    """
+    Helper for logic for Message.to_dict and Message.to_json
+    """
+
+    # The `including_default_value_fields` argument was removed from protobuf 
5.x
+    # and replaced with `always_print_fields_with_no_presence` which is 
similar but
+    # handles optional fields consistently by not affecting them.
+    # The old flag accidentally had inconsistent behavior between optional 
fields
+    # in proto2 and proto3.
+    print_fields = cls._normalize_print_fields_without_presence(
+        always_print_fields_with_no_presence, including_default_value_fields
+    )
+    if _PROTOBUF_MAJOR_VERSION in ("3", "4"):
+        kwargs["including_default_value_fields"] = print_fields
+    else:
+        kwargs["always_print_fields_with_no_presence"] = print_fields
+
+    if float_precision:
+        # float_precision removed in protobuf 7
+        if _PROTOBUF_MAJOR_VERSION in ("3", "4", "5", "6"):
+            kwargs["float_precision"] = float_precision
+            warning_msg = "`float_precision` will be removed in Protobuf 7.x."
+
+        else:  # pragma: NO COVER
+            warning_msg = (
+                "`float_precision` was removed in Protobuf 7.x+, and will be 
ignored."
+            )
+        warnings.warn(warning_msg, DeprecationWarning, stacklevel=3)
+    # suppress similar float_precision warning from protobuf library.
+    with warnings.catch_warnings():
+        warnings.filterwarnings("ignore", message=".*float_precision.*")
+        return map_fn(cls.pb(instance), **kwargs)
+
+
 __all__ = ("Message",)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/proto/version.py 
new/proto_plus-1.27.1/proto/version.py
--- old/proto_plus-1.27.0/proto/version.py      2025-12-16 14:42:34.000000000 
+0100
+++ new/proto_plus-1.27.1/proto/version.py      2026-02-02 18:30:39.000000000 
+0100
@@ -12,4 +12,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-__version__ = "1.27.0"
+__version__ = "1.27.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/proto_plus.egg-info/PKG-INFO 
new/proto_plus-1.27.1/proto_plus.egg-info/PKG-INFO
--- old/proto_plus-1.27.0/proto_plus.egg-info/PKG-INFO  2025-12-16 
14:43:05.000000000 +0100
+++ new/proto_plus-1.27.1/proto_plus.egg-info/PKG-INFO  2026-02-02 
18:31:08.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: proto-plus
-Version: 1.27.0
+Version: 1.27.1
 Summary: Beautiful, Pythonic protocol buffers
 Author-email: Google LLC <[email protected]>
 License: Apache 2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/tests/test_json.py 
new/proto_plus-1.27.1/tests/test_json.py
--- old/proto_plus-1.27.0/tests/test_json.py    2025-12-16 14:42:35.000000000 
+0100
+++ new/proto_plus-1.27.1/tests/test_json.py    2026-02-02 18:30:39.000000000 
+0100
@@ -253,13 +253,29 @@
     assert re.search(r"massKg.*name", j)
 
 
-# TODO: https://github.com/googleapis/proto-plus-python/issues/390
-def test_json_float_precision():
[email protected](
+    "expect_proto_7_plus", [True, False], ids=["proto >= 7", "proto <= 6"]
+)
+def test_json_float_precision(expect_proto_7_plus):
+    if ((expect_proto_7_plus and int(proto.message._PROTOBUF_MAJOR_VERSION) < 
7)) or (
+        (not expect_proto_7_plus and 
int(proto.message._PROTOBUF_MAJOR_VERSION) >= 7)
+    ):
+        pytest.skip("installed proto version does not match test")
+
     class Squid(proto.Message):
         name = proto.Field(proto.STRING, number=1)
         mass_kg = proto.Field(proto.FLOAT, number=2)
 
-    s = Squid(name="Steve", mass_kg=3.14159265)
-    j = Squid.to_json(s, float_precision=3, indent=None)
+    with pytest.warns(DeprecationWarning) as warnings:
+        s = Squid(name="Steve", mass_kg=3.141592)
+        j = Squid.to_json(s, float_precision=3, indent=None)
+
+    assert len(warnings) == 1
 
-    assert j == '{"name": "Steve", "massKg": 3.14}'
+    # for protobuf <7, expect truncated float
+    if expect_proto_7_plus:
+        assert j == '{"name": "Steve", "massKg": 3.141592}'
+        assert "`float_precision` was removed" in warnings[0].message.args[0]
+    else:
+        assert j == '{"name": "Steve", "massKg": 3.14}'
+        assert "`float_precision` will be removed" in 
warnings[0].message.args[0]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/proto_plus-1.27.0/tests/test_message.py 
new/proto_plus-1.27.1/tests/test_message.py
--- old/proto_plus-1.27.0/tests/test_message.py 2025-12-16 14:42:34.000000000 
+0100
+++ new/proto_plus-1.27.1/tests/test_message.py 2026-02-02 18:30:39.000000000 
+0100
@@ -326,15 +326,30 @@
         )
 
 
-# TODO: https://github.com/googleapis/proto-plus-python/issues/390
-def test_serialize_to_dict_float_precision():
[email protected](
+    "expect_proto_7_plus", [True, False], ids=["proto >= 7", "proto <= 6"]
+)
+def test_serialize_to_dict_float_precision(expect_proto_7_plus):
+    if ((expect_proto_7_plus and int(proto.message._PROTOBUF_MAJOR_VERSION) < 
7)) or (
+        (not expect_proto_7_plus and 
int(proto.message._PROTOBUF_MAJOR_VERSION) >= 7)
+    ):
+        pytest.skip("installed proto version does not match test")
+
     class Squid(proto.Message):
         mass_kg = proto.Field(proto.FLOAT, number=1)
 
-    s = Squid(mass_kg=3.14159265)
+    s = Squid(mass_kg=3.141592)
 
-    s_dict = Squid.to_dict(s, float_precision=3)
-    assert s_dict["mass_kg"] == 3.14
+    with pytest.warns(DeprecationWarning) as warnings:
+        s_dict = Squid.to_dict(s, float_precision=3)
+    assert len(warnings) == 1
+    # for protobuf <7, expect truncated float
+    if expect_proto_7_plus:
+        assert s_dict["mass_kg"] == pytest.approx(3.141592)
+        assert "`float_precision` was removed" in warnings[0].message.args[0]
+    else:
+        assert s_dict["mass_kg"] == pytest.approx(3.14)
+        assert "`float_precision` will be removed" in 
warnings[0].message.args[0]
 
 
 def test_unknown_field_deserialize():

Reply via email to