From 5c78ac961199cd094ac4d29634fa4b6bfb73436a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 5 Nov 2024 16:02:04 -0500 Subject: [PATCH 1/4] test: add type flaky to unit test (#1297) Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- noxfile.py | 4 +++- owlbot.py | 1 + setup.py | 2 +- tests/unit/pubsub_v1/publisher/test_publisher_client.py | 7 +++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 2ccbfeae7..47611cdff 100644 --- a/noxfile.py +++ b/noxfile.py @@ -55,7 +55,9 @@ UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] UNIT_TEST_DEPENDENCIES: List[str] = [] -UNIT_TEST_EXTRAS: List[str] = [] +UNIT_TEST_EXTRAS: List[str] = [ + "flaky", +] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] diff --git a/owlbot.py b/owlbot.py index 2e4b00bc9..77eb08250 100644 --- a/owlbot.py +++ b/owlbot.py @@ -337,6 +337,7 @@ cov_level=100, versions=gcp.common.detect_versions(path="./google", default_first=True), unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], + unit_test_extras=["flaky"], system_test_python_versions=["3.12"], system_test_external_dependencies=["psutil","flaky"], ) diff --git a/setup.py b/setup.py index abe06552b..fb2b94fad 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ "opentelemetry-sdk <= 1.22.0; python_version<='3.7'", "opentelemetry-sdk >= 1.27.0; python_version>='3.8'", ] -extras = {"libcst": "libcst >= 0.3.10"} +extras = {"libcst": "libcst >= 0.3.10,", "flaky": "flaky"} url = "https://github.com/googleapis/python-pubsub" package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/tests/unit/pubsub_v1/publisher/test_publisher_client.py b/tests/unit/pubsub_v1/publisher/test_publisher_client.py index abc33f8cb..55198b590 100644 --- a/tests/unit/pubsub_v1/publisher/test_publisher_client.py +++ b/tests/unit/pubsub_v1/publisher/test_publisher_client.py @@ -28,6 +28,8 @@ import pytest import time +from flaky import flaky +from typing import cast, Callable, Any, TypeVar from opentelemetry import trace from google.api_core import gapic_v1 @@ -49,6 +51,10 @@ ) +C = TypeVar("C", bound=Callable[..., Any]) +typed_flaky = cast(Callable[[C], C], flaky(max_runs=5, min_passes=1)) + + def _assert_retries_equal(retry, retry2): # Retry instances cannot be directly compared, because their predicates are # different instances of the same function. We thus manually compare their other @@ -142,6 +148,7 @@ def test_init_w_custom_transport(creds): False, ], ) +@typed_flaky def test_open_telemetry_publisher_options(creds, enable_open_telemetry): if sys.version_info >= (3, 8) or enable_open_telemetry is False: client = publisher.Client( From 347cb38b37a19ee9cbeeede9e16b65f4e1b2ce4b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 6 Nov 2024 16:35:53 -0500 Subject: [PATCH 2/4] chore: partial revert of #1297 (#1298) Co-authored-by: Owl Bot --- noxfile.py | 4 ++-- owlbot.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 47611cdff..7bae0161f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -54,10 +54,10 @@ ] UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] -UNIT_TEST_DEPENDENCIES: List[str] = [] -UNIT_TEST_EXTRAS: List[str] = [ +UNIT_TEST_DEPENDENCIES: List[str] = [ "flaky", ] +UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] diff --git a/owlbot.py b/owlbot.py index 77eb08250..5828fbecf 100644 --- a/owlbot.py +++ b/owlbot.py @@ -337,7 +337,7 @@ cov_level=100, versions=gcp.common.detect_versions(path="./google", default_first=True), unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], - unit_test_extras=["flaky"], + unit_test_dependencies=["flaky"], system_test_python_versions=["3.12"], system_test_external_dependencies=["psutil","flaky"], ) diff --git a/setup.py b/setup.py index fb2b94fad..abe06552b 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ "opentelemetry-sdk <= 1.22.0; python_version<='3.7'", "opentelemetry-sdk >= 1.27.0; python_version>='3.8'", ] -extras = {"libcst": "libcst >= 0.3.10,", "flaky": "flaky"} +extras = {"libcst": "libcst >= 0.3.10"} url = "https://github.com/googleapis/python-pubsub" package_root = os.path.abspath(os.path.dirname(__file__)) From ab22e27954450b4e06ec98fe2e3458056aa8ca60 Mon Sep 17 00:00:00 2001 From: mukund-ananthu <83691193+mukund-ananthu@users.noreply.github.com> Date: Fri, 8 Nov 2024 06:20:25 -0500 Subject: [PATCH 3/4] fix: Add support for Python3.13 (#1302) --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index abe06552b..1d68bf87b 100644 --- a/setup.py +++ b/setup.py @@ -42,6 +42,7 @@ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "proto-plus >= 1.25.0, < 2.0.0dev; python_version >= '3.13'", "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", "grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev", "grpcio-status >= 1.33.2", From 206689982111a01062c67bd48d9a5f513d2fd8d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:55:41 -0500 Subject: [PATCH 4/4] chore(main): release 2.27.1 (#1303) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ google/pubsub/gapic_version.py | 2 +- google/pubsub_v1/gapic_version.py | 2 +- .../snippet_metadata_google.pubsub.v1.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b6aa39c5e..aa8b67ac9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - ".": "2.27.0" + ".": "2.27.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d55c31822..570ee801f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ [1]: https://pypi.org/project/google-cloud-pubsub/#history +## [2.27.1](https://github.com/googleapis/python-pubsub/compare/v2.27.0...v2.27.1) (2024-11-08) + + +### Bug Fixes + +* Add support for Python3.13 ([#1302](https://github.com/googleapis/python-pubsub/issues/1302)) ([ab22e27](https://github.com/googleapis/python-pubsub/commit/ab22e27954450b4e06ec98fe2e3458056aa8ca60)) + ## [2.27.0](https://github.com/googleapis/python-pubsub/compare/v2.26.1...v2.27.0) (2024-11-02) diff --git a/google/pubsub/gapic_version.py b/google/pubsub/gapic_version.py index f0fcebfa4..4e3e20aec 100644 --- a/google/pubsub/gapic_version.py +++ b/google/pubsub/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.27.0" # {x-release-please-version} +__version__ = "2.27.1" # {x-release-please-version} diff --git a/google/pubsub_v1/gapic_version.py b/google/pubsub_v1/gapic_version.py index f0fcebfa4..4e3e20aec 100644 --- a/google/pubsub_v1/gapic_version.py +++ b/google/pubsub_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.27.0" # {x-release-please-version} +__version__ = "2.27.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json index b1aab3038..0800fa5f3 100644 --- a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json +++ b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-pubsub", - "version": "2.27.0" + "version": "2.27.1" }, "snippets": [ {