Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 8a1024b

Browse files
committed
try setting future warning
1 parent 91566b5 commit 8a1024b

File tree

20 files changed

+60
-36
lines changed

20 files changed

+60
-36
lines changed

gapic/templates/%namespace/%name_%version/%sub/__init__.py.j2

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ else: # pragma: NO COVER
3434
f"({_py_version_str}). Google will not post any further " +
3535
f"updates to {_package_label} supporting this Python version. " +
3636
"Please upgrade to the latest Python version, or at " +
37-
f"least to Python 3.9, and then update {_package_label}.")
37+
f"least to Python 3.9, and then update {_package_label}.",
38+
FutureWarning)
3839
if sys.version_info[:2] == (3, 9):
3940
warnings.warn(f"You are using a Python version ({_py_version_str}) " +
4041
f"which Google will stop supporting in {_package_label} when " +
4142
"it reaches its end of life (October 2025). Please " +
4243
"upgrade to the latest Python version, or at " +
4344
"least Python 3.10, before then, and " +
44-
f"then update {_package_label}.")
45+
f"then update {_package_label}.",
46+
FutureWarning)
4547

4648
from packaging.version import parse as parse_version
4749

@@ -80,7 +82,8 @@ else: # pragma: NO COVER
8082
f"{_package_label} can require the higher version, or " +
8183
"(b) you manually update your Python environment to use at " +
8284
f"least version {_next_supported_version} of " +
83-
f"{_dependency_package}.")
85+
f"{_dependency_package}.",
86+
FutureWarning)
8487

8588
{# Import subpackages. -#}
8689
{% for subpackage, _ in api.subpackages|dictsort %}

gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
14941494
client_cert_source=client_cert_source_callback,
14951495
)
14961496
adc.assert_called_once()
1497-
assert len(record) == record # 2 just for debugging; REMOVE
1497+
assert len(record) == 2
14981498

14991499
grpc_ssl_channel_cred.assert_called_once_with(
15001500
certificate_chain=b"cert bytes", private_key=b"key bytes"

tests/integration/goldens/asset/google/cloud/asset_v1/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@
3737
f"({_py_version_str}). Google will not post any further " +
3838
f"updates to {_package_label} supporting this Python version. " +
3939
"Please upgrade to the latest Python version, or at " +
40-
f"least to Python 3.9, and then update {_package_label}.")
40+
f"least to Python 3.9, and then update {_package_label}.",
41+
FutureWarning)
4142
if sys.version_info[:2] == (3, 9):
4243
warnings.warn(f"You are using a Python version ({_py_version_str}) " +
4344
f"which Google will stop supporting in {_package_label} when " +
4445
"it reaches its end of life (October 2025). Please " +
4546
"upgrade to the latest Python version, or at " +
4647
"least Python 3.10, before then, and " +
47-
f"then update {_package_label}.")
48+
f"then update {_package_label}.",
49+
FutureWarning)
4850

4951
from packaging.version import parse as parse_version
5052

@@ -83,7 +85,8 @@ def _get_version(dependency_name):
8385
f"{_package_label} can require the higher version, or " +
8486
"(b) you manually update your Python environment to use at " +
8587
f"least version {_next_supported_version} of " +
86-
f"{_dependency_package}.")
88+
f"{_dependency_package}.",
89+
FutureWarning)
8790

8891

8992
from .services.asset_service import AssetServiceClient

tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17734,7 +17734,7 @@ def test_asset_service_transport_channel_mtls_with_client_cert_source(
1773417734
client_cert_source=client_cert_source_callback,
1773517735
)
1773617736
adc.assert_called_once()
17737-
assert len(record) == record # 2 just for debugging; REMOVE
17737+
assert len(record) == 2
1773817738

1773917739
grpc_ssl_channel_cred.assert_called_once_with(
1774017740
certificate_chain=b"cert bytes", private_key=b"key bytes"

tests/integration/goldens/credentials/google/iam/credentials_v1/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@
3737
f"({_py_version_str}). Google will not post any further " +
3838
f"updates to {_package_label} supporting this Python version. " +
3939
"Please upgrade to the latest Python version, or at " +
40-
f"least to Python 3.9, and then update {_package_label}.")
40+
f"least to Python 3.9, and then update {_package_label}.",
41+
FutureWarning)
4142
if sys.version_info[:2] == (3, 9):
4243
warnings.warn(f"You are using a Python version ({_py_version_str}) " +
4344
f"which Google will stop supporting in {_package_label} when " +
4445
"it reaches its end of life (October 2025). Please " +
4546
"upgrade to the latest Python version, or at " +
4647
"least Python 3.10, before then, and " +
47-
f"then update {_package_label}.")
48+
f"then update {_package_label}.",
49+
FutureWarning)
4850

4951
from packaging.version import parse as parse_version
5052

@@ -83,7 +85,8 @@ def _get_version(dependency_name):
8385
f"{_package_label} can require the higher version, or " +
8486
"(b) you manually update your Python environment to use at " +
8587
f"least version {_next_supported_version} of " +
86-
f"{_dependency_package}.")
88+
f"{_dependency_package}.",
89+
FutureWarning)
8790

8891

8992
from .services.iam_credentials import IAMCredentialsClient

tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3994,7 +3994,7 @@ def test_iam_credentials_transport_channel_mtls_with_client_cert_source(
39943994
client_cert_source=client_cert_source_callback,
39953995
)
39963996
adc.assert_called_once()
3997-
assert len(record) == record # 2 just for debugging; REMOVE
3997+
assert len(record) == 2
39983998

39993999
grpc_ssl_channel_cred.assert_called_once_with(
40004000
certificate_chain=b"cert bytes", private_key=b"key bytes"

tests/integration/goldens/eventarc/google/cloud/eventarc_v1/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@
3737
f"({_py_version_str}). Google will not post any further " +
3838
f"updates to {_package_label} supporting this Python version. " +
3939
"Please upgrade to the latest Python version, or at " +
40-
f"least to Python 3.9, and then update {_package_label}.")
40+
f"least to Python 3.9, and then update {_package_label}.",
41+
FutureWarning)
4142
if sys.version_info[:2] == (3, 9):
4243
warnings.warn(f"You are using a Python version ({_py_version_str}) " +
4344
f"which Google will stop supporting in {_package_label} when " +
4445
"it reaches its end of life (October 2025). Please " +
4546
"upgrade to the latest Python version, or at " +
4647
"least Python 3.10, before then, and " +
47-
f"then update {_package_label}.")
48+
f"then update {_package_label}.",
49+
FutureWarning)
4850

4951
from packaging.version import parse as parse_version
5052

@@ -83,7 +85,8 @@ def _get_version(dependency_name):
8385
f"{_package_label} can require the higher version, or " +
8486
"(b) you manually update your Python environment to use at " +
8587
f"least version {_next_supported_version} of " +
86-
f"{_dependency_package}.")
88+
f"{_dependency_package}.",
89+
FutureWarning)
8790

8891

8992
from .services.eventarc import EventarcClient

tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15400,7 +15400,7 @@ def test_eventarc_transport_channel_mtls_with_client_cert_source(
1540015400
client_cert_source=client_cert_source_callback,
1540115401
)
1540215402
adc.assert_called_once()
15403-
assert len(record) == record # 2 just for debugging; REMOVE
15403+
assert len(record) == 2
1540415404

1540515405
grpc_ssl_channel_cred.assert_called_once_with(
1540615406
certificate_chain=b"cert bytes", private_key=b"key bytes"

tests/integration/goldens/logging/google/cloud/logging_v2/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@
3737
f"({_py_version_str}). Google will not post any further " +
3838
f"updates to {_package_label} supporting this Python version. " +
3939
"Please upgrade to the latest Python version, or at " +
40-
f"least to Python 3.9, and then update {_package_label}.")
40+
f"least to Python 3.9, and then update {_package_label}.",
41+
FutureWarning)
4142
if sys.version_info[:2] == (3, 9):
4243
warnings.warn(f"You are using a Python version ({_py_version_str}) " +
4344
f"which Google will stop supporting in {_package_label} when " +
4445
"it reaches its end of life (October 2025). Please " +
4546
"upgrade to the latest Python version, or at " +
4647
"least Python 3.10, before then, and " +
47-
f"then update {_package_label}.")
48+
f"then update {_package_label}.",
49+
FutureWarning)
4850

4951
from packaging.version import parse as parse_version
5052

@@ -83,7 +85,8 @@ def _get_version(dependency_name):
8385
f"{_package_label} can require the higher version, or " +
8486
"(b) you manually update your Python environment to use at " +
8587
f"least version {_next_supported_version} of " +
86-
f"{_dependency_package}.")
88+
f"{_dependency_package}.",
89+
FutureWarning)
8790

8891

8992
from .services.config_service_v2 import ConfigServiceV2Client

tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12919,7 +12919,7 @@ def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1291912919
client_cert_source=client_cert_source_callback,
1292012920
)
1292112921
adc.assert_called_once()
12922-
assert len(record) == record # 2 just for debugging; REMOVE
12922+
assert len(record) == 2
1292312923

1292412924
grpc_ssl_channel_cred.assert_called_once_with(
1292512925
certificate_chain=b"cert bytes", private_key=b"key bytes"

0 commit comments

Comments
 (0)