diff --git a/packages/proto-plus/docs/fields.rst b/packages/proto-plus/docs/fields.rst index 1961cff07407..e85934944dc6 100644 --- a/packages/proto-plus/docs/fields.rst +++ b/packages/proto-plus/docs/fields.rst @@ -81,7 +81,7 @@ Declare them in Python using the :class:`~.RepeatedField` class: >>> row.values = [struct_pb2.Value(string_value="hello")] Traceback (most recent call last): File "", line 1, in - File "/usr/local/google/home/busunkim/github/python-automl/.nox/unit-3-8/lib/python3.8/site-packages/proto/message.py", line 543, in __setattr__ + File "/usr/local/google/home/busunkim/github/python-automl/.nox/unit-3-10/lib/python3.10/site-packages/proto/message.py", line 543, in __setattr__ self._pb.MergeFrom(self._meta.pb(**{key: pb_value})) TypeError: Value must be iterable diff --git a/packages/proto-plus/noxfile.py b/packages/proto-plus/noxfile.py index 1cf600b1b1b1..265dc22711ea 100644 --- a/packages/proto-plus/noxfile.py +++ b/packages/proto-plus/noxfile.py @@ -30,7 +30,6 @@ DEFAULT_PYTHON_VERSION = "3.14" PYTHON_VERSIONS = [ - "3.9", "3.10", "3.11", "3.12", diff --git a/packages/proto-plus/proto/enums.py b/packages/proto-plus/proto/enums.py index d3ab6b792023..6ddf63a2cce5 100644 --- a/packages/proto-plus/proto/enums.py +++ b/packages/proto-plus/proto/enums.py @@ -55,8 +55,7 @@ def __new__(mcls, name, bases, attrs): opts = attrs.pop(pb_options, {}) # This is the only portable way to remove the _pb_options name # from the enum attrs. - # In 3.7 onwards, we can define an _ignore_ attribute and do some - # mucking around with that. + # TODO: Use _ignore_ attribute to ignore _pb_options (Issue #16911) if pb_options in attrs._member_names: if isinstance(attrs._member_names, list): idx = attrs._member_names.index(pb_options) diff --git a/packages/proto-plus/proto/marshal/collections/repeated.py b/packages/proto-plus/proto/marshal/collections/repeated.py index a6560411cd71..3ce3923f6dc8 100644 --- a/packages/proto-plus/proto/marshal/collections/repeated.py +++ b/packages/proto-plus/proto/marshal/collections/repeated.py @@ -166,10 +166,10 @@ def __setitem__(self, key, value): else: # Is an extended slice. indices = range(start, stop, step) - if len(value) != len(indices): # XXX: Use PEP 572 on 3.8+ + if (v_len := len(value)) != len(indices): raise ValueError( f"attempt to assign sequence of size " - f"{len(value)} to extended slice of size " + f"{v_len} to extended slice of size " f"{len(indices)}" ) diff --git a/packages/proto-plus/pyproject.toml b/packages/proto-plus/pyproject.toml index 568db53e0d2d..efe9a2a3b2ec 100644 --- a/packages/proto-plus/pyproject.toml +++ b/packages/proto-plus/pyproject.toml @@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta" name = "proto-plus" authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }] license = { text = "Apache 2.0" } -requires-python = ">=3.9" +requires-python = ">=3.10" description = "Beautiful, Pythonic protocol buffers" readme = "README.rst" classifiers = [ @@ -29,7 +29,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",