|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -# Copyright 2025 Google LLC |
| 2 | +# Copyright 2026 Google LLC |
3 | 3 | # |
4 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | # you may not use this file except in compliance with the License. |
|
21 | 21 |
|
22 | 22 | __version__ = package_version.__version__ |
23 | 23 |
|
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 |
31 | 25 |
|
32 | 26 | from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient |
33 | 27 | from .types.asset_service import ContentType, ListAssetsRequest, ListAssetsResponse |
|
42 | 36 | # An older version of api_core is installed which does not define the |
43 | 37 | # functions above. We do equivalent checks manually. |
44 | 38 | try: |
45 | | - import sys |
46 | 39 | import warnings |
47 | 40 |
|
48 | 41 | _py_version_str = sys.version.split()[0] |
49 | 42 | _package_label = "google.cloud.asset_v1p5beta1" |
50 | | - if sys.version_info < (3, 9): |
| 43 | + if sys.version_info < (3, 10): |
51 | 44 | warnings.warn( |
52 | 45 | "You are using a non-supported Python version " |
53 | 46 | + f"({_py_version_str}). Google will not post any further " |
54 | 47 | + f"updates to {_package_label} supporting this Python version. " |
55 | 48 | + "Please upgrade to the latest Python version, or at " |
56 | | - + f"least to Python 3.9, and then update {_package_label}.", |
57 | | - FutureWarning, |
58 | | - ) |
59 | | - if sys.version_info[:2] == (3, 9): |
60 | | - warnings.warn( |
61 | | - f"You are using a Python version ({_py_version_str}) " |
62 | | - + f"which Google will stop supporting in {_package_label} in " |
63 | | - + "January 2026. Please " |
64 | | - + "upgrade to the latest Python version, or at " |
65 | | - + "least to Python 3.10, before then, and " |
66 | | - + f"then update {_package_label}.", |
| 49 | + + f"least to Python 3.10, and then update {_package_label}.", |
67 | 50 | FutureWarning, |
68 | 51 | ) |
69 | 52 |
|
|
0 commit comments