Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ replacements:
]
before: extras = \{\}
after: |
extras = {"pandas": "pandas >= 1.1.3"}
extras = {"pandas": "pandas >= 1.3.4"}
count: 1
- paths: [
packages/google-cloud-monitoring/noxfile.py,
Expand Down Expand Up @@ -414,3 +414,21 @@ replacements:
before: '\n "--check-untyped-defs",'
after: '\n # TODO(https://github.com/googleapis/google-cloud-python/issues/16083)\n # "--check-untyped-defs",'
count: 1
- paths: [
"packages/google-cloud-monitoring/noxfile.py",
]
before: '\n # Install all dependencies\n session.install\("-e", "\."\)'
after: '\n # Install all dependencies\n session.install("-e", ".[pandas]")'
count: 2
- paths: [
"packages/google-cloud-monitoring/testing/constraints-3.10.txt",
]
before: |
google-api-core==2.17.1
google-auth==2.14.1
after: |
google-api-core==2.17.1
pandas==1.3.4
numpy==1.21.3
google-auth==2.14.1
count: 1
1 change: 0 additions & 1 deletion librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,6 @@ libraries:
version: 2.30.0
apis:
- path: google/monitoring/v3
skip_generate: true
python:
library_type: GAPIC_COMBO
opt_args_by_api:
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-monitoring/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -83,7 +83,7 @@

# General information about the project.
project = "google-cloud-monitoring"
copyright = "2025, Google, LLC"
copyright = "2026, Google, LLC"
author = "Google APIs"

# The version info for the project you're documenting, acts as replacement for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,13 +21,7 @@

__version__ = package_version.__version__

if sys.version_info >= (3, 8): # pragma: NO COVER
from importlib import metadata
else: # pragma: NO COVER
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
# this code path once we drop support for Python 3.7
import importlib_metadata as metadata

from importlib import metadata

from .services.alert_policy_service import (
AlertPolicyServiceAsyncClient,
Expand Down Expand Up @@ -183,28 +177,17 @@
# An older version of api_core is installed which does not define the
# functions above. We do equivalent checks manually.
try:
import sys
import warnings

_py_version_str = sys.version.split()[0]
_package_label = "google.cloud.monitoring_v3"
if sys.version_info < (3, 9):
if sys.version_info < (3, 10):
warnings.warn(
"You are using a non-supported Python version "
+ f"({_py_version_str}). Google will not post any further "
+ f"updates to {_package_label} supporting this Python version. "
+ "Please upgrade to the latest Python version, or at "
+ f"least to Python 3.9, and then update {_package_label}.",
FutureWarning,
)
if sys.version_info[:2] == (3, 9):
warnings.warn(
f"You are using a Python version ({_py_version_str}) "
+ f"which Google will stop supporting in {_package_label} in "
+ "January 2026. Please "
+ "upgrade to the latest Python version, or at "
+ "least to Python 3.10, before then, and "
+ f"then update {_package_label}.",
+ f"least to Python 3.10, and then update {_package_label}.",
FutureWarning,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -191,18 +191,17 @@ class ListMetricDescriptorsRequest(proto.Message):
resource types that have recent data (within
roughly 25 hours) will be included in the
response.

- If a metric descriptor enumerates monitored
resource types, only the monitored resource
- If a metric descriptor enumerates monitored
resource types, only the monitored resource
types for which the metric type has recent
data will be included in the returned
data will be included in the returned
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to take a look at the extra whitespace being added here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented off-line in chat.

metric descriptor, and if none of them have
recent data, the metric descriptor will not be
returned.
- If a metric descriptor does not enumerate the
compatible monitored resource types, it
- If a metric descriptor does not enumerate the
compatible monitored resource types, it
will be returned only if the metric type has
recent data for some monitored resource
recent data for some monitored resource
type. The returned descriptor will not
enumerate any monitored resource types.
Comment thread
chalmerlowe marked this conversation as resolved.
"""
Expand Down
8 changes: 3 additions & 5 deletions packages/google-cloud-monitoring/noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,6 @@
LINT_PATHS.append("samples")

ALL_PYTHON = [
"3.9",
"3.10",
"3.11",
"3.12",
Expand Down Expand Up @@ -392,7 +391,6 @@ def docs(session):
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
session.run(
"sphinx-build",
"-W", # warnings as errors
"-T", # show full traceback on exception
Comment thread
chalmerlowe marked this conversation as resolved.
"-N", # no colors
"-b",
Expand Down Expand Up @@ -465,7 +463,7 @@ def prerelease_deps(session, protobuf_implementation):
"""

# Install all dependencies
session.install("-e", ".")
session.install("-e", ".[pandas]")

# Install dependencies for the unit test environment
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
Expand Down Expand Up @@ -558,7 +556,7 @@ def core_deps_from_source(session, protobuf_implementation):
"""

# Install all dependencies
session.install("-e", ".")
session.install("-e", ".[pandas]")

# Install dependencies for the unit test environment
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
Expand Down
13 changes: 6 additions & 7 deletions packages/google-cloud-monitoring/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,17 +39,17 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"google-api-core[grpc] >= 2.17.1, <3.0.0",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
Comment thread
chalmerlowe marked this conversation as resolved.
"grpcio >= 1.33.2, < 2.0.0",
"grpcio >= 1.44.0, < 2.0.0",
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
"proto-plus >= 1.22.3, <2.0.0",
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf >= 4.25.8, < 8.0.0",
]
extras = {"pandas": "pandas >= 1.1.3"}
extras = {"pandas": "pandas >= 1.3.4"}

url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-monitoring"

Expand All @@ -72,15 +72,14 @@
long_description=readme,
author="Google LLC",
author_email="googleapis-packages@google.com",
license="Apache 2.0",
license="Apache-2.0",
url=url,
classifiers=[
release_status,
"Intended Audience :: Developers",
"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",
Expand All @@ -91,7 +90,7 @@
],
platforms="Posix; MacOS X; Windows",
packages=packages,
python_requires=">=3.9",
python_requires=">=3.10",
install_requires=dependencies,
extras_require=extras,
include_package_data=True,
Expand Down
23 changes: 13 additions & 10 deletions packages/google-cloud-monitoring/testing/constraints-3.10.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
google-auth
grpcio
proto-plus
protobuf
# cryptography is a direct dependency of google-auth
cryptography
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file,
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.17.1
pandas==1.3.4
numpy==1.21.3
google-auth==2.14.1
Comment thread
chalmerlowe marked this conversation as resolved.
grpcio==1.44.0
proto-plus==1.22.3
protobuf==4.25.8
16 changes: 0 additions & 16 deletions packages/google-cloud-monitoring/testing/constraints-3.9.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,18 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os

# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock

import json
import math
import os
from collections.abc import Mapping, Sequence
from unittest import mock
from unittest.mock import AsyncMock

import grpc
import pytest
Expand Down Expand Up @@ -1880,11 +1874,7 @@ async def test_list_alert_policies_async_pages():
RuntimeError,
)
pages = []
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_alert_policies(request={})
).pages:
async for page_ in (await client.list_alert_policies(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,18 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os

# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock

import json
import math
import os
from collections.abc import Mapping, Sequence
from unittest import mock
from unittest.mock import AsyncMock

import grpc
import pytest
Expand Down Expand Up @@ -1793,11 +1787,7 @@ async def test_list_groups_async_pages():
RuntimeError,
)
pages = []
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_groups(request={})
).pages:
async for page_ in (await client.list_groups(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down Expand Up @@ -3668,11 +3658,7 @@ async def test_list_group_members_async_pages():
RuntimeError,
)
pages = []
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_group_members(request={})
).pages:
async for page_ in (await client.list_group_members(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
Loading
Loading