From 1ee5d36a92d3518914b798961ff698dbe537436e Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 4 Nov 2024 22:53:46 +0000 Subject: [PATCH 1/7] remove nox --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 2e4b00bc9..b80c1768c 100644 --- a/owlbot.py +++ b/owlbot.py @@ -324,7 +324,7 @@ if count < 1: raise Exception(".coveragerc replacement failed.") - s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"]) + s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt", "noxfile.py"]) s.remove_staging_dirs() # ---------------------------------------------------------------------------- From bae76c509dcb10def0da4efe2949b0d123b257eb Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 4 Nov 2024 22:58:23 +0000 Subject: [PATCH 2/7] add flaky type to test case --- tests/unit/pubsub_v1/publisher/test_publisher_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/pubsub_v1/publisher/test_publisher_client.py b/tests/unit/pubsub_v1/publisher/test_publisher_client.py index abc33f8cb..25492378c 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 @@ -48,6 +50,8 @@ PublishMessageWrapper, ) +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 @@ -142,6 +146,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 8b9d15a5790810e590b73c1253fd81feade4fb45 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 4 Nov 2024 23:04:35 +0000 Subject: [PATCH 3/7] add unit test extra --- owlbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owlbot.py b/owlbot.py index b80c1768c..3789f6c7d 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"], ) From ce6beb1253f577c83599fa3ae96afcee584cf4a8 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 4 Nov 2024 23:06:42 +0000 Subject: [PATCH 4/7] fix lint issues --- tests/unit/pubsub_v1/publisher/test_publisher_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/pubsub_v1/publisher/test_publisher_client.py b/tests/unit/pubsub_v1/publisher/test_publisher_client.py index 25492378c..55198b590 100644 --- a/tests/unit/pubsub_v1/publisher/test_publisher_client.py +++ b/tests/unit/pubsub_v1/publisher/test_publisher_client.py @@ -50,9 +50,11 @@ PublishMessageWrapper, ) + 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 From 7c21115377d8e63f85a0b3c7606d3c90d1a82de7 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 4 Nov 2024 23:19:20 +0000 Subject: [PATCH 5/7] add flaky as an extra --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index abe06552b..ab5f467f8 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,8 @@ "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__)) From 6ae9a65bab1aa93ab762b1cccc2d4b691b452b84 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 4 Nov 2024 23:21:57 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 4 +++- setup.py | 3 +-- 2 files changed, 4 insertions(+), 3 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/setup.py b/setup.py index ab5f467f8..fb2b94fad 100644 --- a/setup.py +++ b/setup.py @@ -50,8 +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,", "flaky": "flaky"} url = "https://github.com/googleapis/python-pubsub" package_root = os.path.abspath(os.path.dirname(__file__)) From 460c3da3d4eafc3d44c30c54c529d8688a0f9fc1 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Tue, 5 Nov 2024 11:01:00 -0500 Subject: [PATCH 7/7] Update owlbot.py Co-authored-by: Anthonios Partheniou --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 3789f6c7d..77eb08250 100644 --- a/owlbot.py +++ b/owlbot.py @@ -324,7 +324,7 @@ if count < 1: raise Exception(".coveragerc replacement failed.") - s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt", "noxfile.py"]) + s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"]) s.remove_staging_dirs() # ----------------------------------------------------------------------------