Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 042dc5c

Browse filesBrowse files
authored
feat: regenerate monitoring using generator v1.32.0 (#17165)
Updates post processing to account for dropping support for Python 3.7, 3.8, 3.9 and impacts that has on using 3.10 for lower bounds testing. Changes: * Adds `pandas` and `numpy` to `constraints-3.10.txt` and installs `pandas` extra in `prerelease_deps` and `core_deps_from_source` nox sessions. * Updates `pandas` dependency lower bound to `1.3.4` and updates `constraints-3.10.txt` to use `pandas 1.3.4` and `numpy 1.21.3` to avoid pip build errors on Python 3.10. Partially corrects #17153 🦕
1 parent 3980e0c commit 042dc5c
Copy full SHA for 042dc5c

17 files changed

+100-215Lines changed: 100 additions & 215 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml‎

Copy file name to clipboardExpand all lines: .librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml
+19-1Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ replacements:
161161
]
162162
before: extras = \{\}
163163
after: |
164-
extras = {"pandas": "pandas >= 1.1.3"}
164+
extras = {"pandas": "pandas >= 1.3.4"}
165165
count: 1
166166
- paths: [
167167
packages/google-cloud-monitoring/noxfile.py,
@@ -414,3 +414,21 @@ replacements:
414414
before: '\n "--check-untyped-defs",'
415415
after: '\n # TODO(https://github.com/googleapis/google-cloud-python/issues/16083)\n # "--check-untyped-defs",'
416416
count: 1
417+
- paths: [
418+
"packages/google-cloud-monitoring/noxfile.py",
419+
]
420+
before: '\n # Install all dependencies\n session.install\("-e", "\."\)'
421+
after: '\n # Install all dependencies\n session.install("-e", ".[pandas]")'
422+
count: 2
423+
- paths: [
424+
"packages/google-cloud-monitoring/testing/constraints-3.10.txt",
425+
]
426+
before: |
427+
google-api-core==2.17.1
428+
google-auth==2.14.1
429+
after: |
430+
google-api-core==2.17.1
431+
pandas==1.3.4
432+
numpy==1.21.3
433+
google-auth==2.14.1
434+
count: 1
Collapse file

‎librarian.yaml‎

Copy file name to clipboardExpand all lines: librarian.yaml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,6 @@ libraries:
14291429
version: 2.30.0
14301430
apis:
14311431
- path: google/monitoring/v3
1432-
skip_generate: true
14331432
python:
14341433
library_type: GAPIC_COMBO
14351434
opt_args_by_api:
Collapse file

‎packages/google-cloud-monitoring/docs/conf.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/docs/conf.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@
8383

8484
# General information about the project.
8585
project = "google-cloud-monitoring"
86-
copyright = "2025, Google, LLC"
86+
copyright = "2026, Google, LLC"
8787
author = "Google APIs"
8888

8989
# The version info for the project you're documenting, acts as replacement for
Collapse file

‎packages/google-cloud-monitoring/google/cloud/monitoring_v3/__init__.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/google/cloud/monitoring_v3/__init__.py
+4-21Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -21,13 +21,7 @@
2121

2222
__version__ = package_version.__version__
2323

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

3226
from .services.alert_policy_service import (
3327
AlertPolicyServiceAsyncClient,
@@ -183,28 +177,17 @@
183177
# An older version of api_core is installed which does not define the
184178
# functions above. We do equivalent checks manually.
185179
try:
186-
import sys
187180
import warnings
188181

189182
_py_version_str = sys.version.split()[0]
190183
_package_label = "google.cloud.monitoring_v3"
191-
if sys.version_info < (3, 9):
184+
if sys.version_info < (3, 10):
192185
warnings.warn(
193186
"You are using a non-supported Python version "
194187
+ f"({_py_version_str}). Google will not post any further "
195188
+ f"updates to {_package_label} supporting this Python version. "
196189
+ "Please upgrade to the latest Python version, or at "
197-
+ f"least to Python 3.9, and then update {_package_label}.",
198-
FutureWarning,
199-
)
200-
if sys.version_info[:2] == (3, 9):
201-
warnings.warn(
202-
f"You are using a Python version ({_py_version_str}) "
203-
+ f"which Google will stop supporting in {_package_label} in "
204-
+ "January 2026. Please "
205-
+ "upgrade to the latest Python version, or at "
206-
+ "least to Python 3.10, before then, and "
207-
+ f"then update {_package_label}.",
190+
+ f"least to Python 3.10, and then update {_package_label}.",
208191
FutureWarning,
209192
)
210193

Collapse file

‎packages/google-cloud-monitoring/google/cloud/monitoring_v3/types/metric_service.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/google/cloud/monitoring_v3/types/metric_service.py
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -191,18 +191,17 @@ class ListMetricDescriptorsRequest(proto.Message):
191191
resource types that have recent data (within
192192
roughly 25 hours) will be included in the
193193
response.
194-
195-
- If a metric descriptor enumerates monitored
196-
resource types, only the monitored resource
194+
- If a metric descriptor enumerates monitored
195+
resource types, only the monitored resource
197196
types for which the metric type has recent
198-
data will be included in the returned
197+
data will be included in the returned
199198
metric descriptor, and if none of them have
200199
recent data, the metric descriptor will not be
201200
returned.
202-
- If a metric descriptor does not enumerate the
203-
compatible monitored resource types, it
201+
- If a metric descriptor does not enumerate the
202+
compatible monitored resource types, it
204203
will be returned only if the metric type has
205-
recent data for some monitored resource
204+
recent data for some monitored resource
206205
type. The returned descriptor will not
207206
enumerate any monitored resource types.
208207
"""
Collapse file

‎packages/google-cloud-monitoring/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/noxfile.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
3131
LINT_PATHS.append("samples")
3232

3333
ALL_PYTHON = [
34-
"3.9",
3534
"3.10",
3635
"3.11",
3736
"3.12",
@@ -392,7 +391,6 @@ def docs(session):
392391
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
393392
session.run(
394393
"sphinx-build",
395-
"-W", # warnings as errors
396394
"-T", # show full traceback on exception
397395
"-N", # no colors
398396
"-b",
@@ -465,7 +463,7 @@ def prerelease_deps(session, protobuf_implementation):
465463
"""
466464

467465
# Install all dependencies
468-
session.install("-e", ".")
466+
session.install("-e", ".[pandas]")
469467

470468
# Install dependencies for the unit test environment
471469
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -558,7 +556,7 @@ def core_deps_from_source(session, protobuf_implementation):
558556
"""
559557

560558
# Install all dependencies
561-
session.install("-e", ".")
559+
session.install("-e", ".[pandas]")
562560

563561
# Install dependencies for the unit test environment
564562
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
Collapse file

‎packages/google-cloud-monitoring/setup.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/setup.py
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -39,17 +39,17 @@
3939
release_status = "Development Status :: 5 - Production/Stable"
4040

4141
dependencies = [
42-
"google-api-core[grpc] >= 2.11.0, <3.0.0",
42+
"google-api-core[grpc] >= 2.17.1, <3.0.0",
4343
# Exclude incompatible versions of `google-auth`
4444
# See https://github.com/googleapis/google-cloud-python/issues/12364
4545
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
46-
"grpcio >= 1.33.2, < 2.0.0",
46+
"grpcio >= 1.44.0, < 2.0.0",
4747
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
4848
"proto-plus >= 1.22.3, <2.0.0",
4949
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
5050
"protobuf >= 4.25.8, < 8.0.0",
5151
]
52-
extras = {"pandas": "pandas >= 1.1.3"}
52+
extras = {"pandas": "pandas >= 1.3.4"}
5353

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

@@ -72,15 +72,14 @@
7272
long_description=readme,
7373
author="Google LLC",
7474
author_email="googleapis-packages@google.com",
75-
license="Apache 2.0",
75+
license="Apache-2.0",
7676
url=url,
7777
classifiers=[
7878
release_status,
7979
"Intended Audience :: Developers",
8080
"License :: OSI Approved :: Apache Software License",
8181
"Programming Language :: Python",
8282
"Programming Language :: Python :: 3",
83-
"Programming Language :: Python :: 3.9",
8483
"Programming Language :: Python :: 3.10",
8584
"Programming Language :: Python :: 3.11",
8685
"Programming Language :: Python :: 3.12",
@@ -91,7 +90,7 @@
9190
],
9291
platforms="Posix; MacOS X; Windows",
9392
packages=packages,
94-
python_requires=">=3.9",
93+
python_requires=">=3.10",
9594
install_requires=dependencies,
9695
extras_require=extras,
9796
include_package_data=True,
Collapse file
+13-10Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
3-
# List all library dependencies and extras in this file.
4-
google-api-core
5-
google-auth
6-
grpcio
7-
proto-plus
8-
protobuf
9-
# cryptography is a direct dependency of google-auth
10-
cryptography
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List all library dependencies and extras in this file,
4+
# pinning their versions to their lower bounds.
5+
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
6+
# then this file should have google-cloud-foo==1.14.0
7+
google-api-core==2.17.1
8+
pandas==1.3.4
9+
numpy==1.21.3
10+
google-auth==2.14.1
11+
grpcio==1.44.0
12+
proto-plus==1.22.3
13+
protobuf==4.25.8
Collapse file

‎packages/google-cloud-monitoring/testing/constraints-3.9.txt‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/testing/constraints-3.9.txt
-16Lines changed: 0 additions & 16 deletions
This file was deleted.
Collapse file

‎packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py
+5-15Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -13,18 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import os
17-
18-
# try/except added for compatibility with python < 3.8
19-
try:
20-
from unittest import mock
21-
from unittest.mock import AsyncMock # pragma: NO COVER
22-
except ImportError: # pragma: NO COVER
23-
import mock
24-
2516
import json
2617
import math
18+
import os
2719
from collections.abc import Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -1880,11 +1874,7 @@ async def test_list_alert_policies_async_pages():
18801874
RuntimeError,
18811875
)
18821876
pages = []
1883-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1884-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1885-
async for page_ in ( # pragma: no branch
1886-
await client.list_alert_policies(request={})
1887-
).pages:
1877+
async for page_ in (await client.list_alert_policies(request={})).pages:
18881878
pages.append(page_)
18891879
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
18901880
assert page_.raw_page.next_page_token == token

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.