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 f46b37f

Browse filesBrowse files
feat: [Many APIs] Add support for Python 3.12 (#12074)
- [ ] Regenerate this pull request now. docs: updated doc for speech mode PiperOrigin-RevId: 586469693 Source-Link: googleapis/googleapis@e8148d6 Source-Link: googleapis/googleapis-gen@85136bd Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy1pbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxhbmd1YWdlLy5Pd2xCb3QueWFtbCIsImgiOiI4NTEzNmJkMDQzODNlZDcxNzJiYjE4YjdiOGQyMjBkZDdmZjZiM2EwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxpZmUtc2NpZW5jZXMvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1hbmFnZWQtaWRlbnRpdGllcy8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1lZGlhLXRyYW5zbGF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI4NTEzNmJkMDQzODNlZDcxNzJiYjE4YjdiOGQyMjBkZDdmZjZiM2EwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1lbWNhY2hlL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y-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXByaXZhdGUtY2EvLk93bEJvdC55YW1sIiwiaCI6Ijg1MTM2YmQwNDM4M2VkNzE3MmJiMThiN2I4ZDIyMGRkN2ZmNmIzYTAifQ== BEGIN_COMMIT_OVERRIDE feat: Add support for python 3.12 feat: Introduce compatibility with native namespace packages fix: Use `retry_async` instead of `retry` in async client fix: Require proto-plus >= 1.22.3 END_COMMIT_OVERRIDE --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 0e3a902 commit f46b37f
Copy full SHA for f46b37f

File tree

139 files changed

+1214
-1124
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

139 files changed

+1214
-1124
lines changed

‎packages/google-cloud-kms-inventory/CONTRIBUTING.rst

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/CONTRIBUTING.rst
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
25+
3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7272

7373
- To run a single unit test::
7474

75-
$ nox -s unit-3.11 -- -k <name of test>
75+
$ nox -s unit-3.12 -- -k <name of test>
7676

7777

7878
.. note::
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system-3.11 -- -k <name of test>
146+
$ nox -s system-3.12 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
151+
System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local
@@ -226,12 +226,14 @@ We support:
226226
- `Python 3.9`_
227227
- `Python 3.10`_
228228
- `Python 3.11`_
229+
- `Python 3.12`_
229230

230231
.. _Python 3.7: https://docs.python.org/3.7/
231232
.. _Python 3.8: https://docs.python.org/3.8/
232233
.. _Python 3.9: https://docs.python.org/3.9/
233234
.. _Python 3.10: https://docs.python.org/3.10/
234235
.. _Python 3.11: https://docs.python.org/3.11/
236+
.. _Python 3.12: https://docs.python.org/3.12/
235237

236238

237239
Supported versions can be found in our ``noxfile.py`` `config`_.

‎packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/async_client.py

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/async_client.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030

3131
from google.api_core import exceptions as core_exceptions
3232
from google.api_core import gapic_v1
33-
from google.api_core import retry as retries
33+
from google.api_core import retry_async as retries
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
3737

3838
from google.cloud.kms_inventory_v1 import gapic_version as package_version
3939

4040
try:
41-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
41+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4242
except AttributeError: # pragma: NO COVER
43-
OptionalRetry = Union[retries.Retry, object] # type: ignore
43+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4444

4545
from google.cloud.kms_v1.types import resources
4646

@@ -281,7 +281,7 @@ async def sample_list_crypto_keys():
281281
This corresponds to the ``parent`` field
282282
on the ``request`` instance; if ``request`` is provided, this
283283
should not be set.
284-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
284+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
285285
should be retried.
286286
timeout (float): The timeout for this request.
287287
metadata (Sequence[Tuple[str, str]]): Strings which should be

‎packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/async_client.py

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/async_client.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030

3131
from google.api_core import exceptions as core_exceptions
3232
from google.api_core import gapic_v1
33-
from google.api_core import retry as retries
33+
from google.api_core import retry_async as retries
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
3737

3838
from google.cloud.kms_inventory_v1 import gapic_version as package_version
3939

4040
try:
41-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
41+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4242
except AttributeError: # pragma: NO COVER
43-
OptionalRetry = Union[retries.Retry, object] # type: ignore
43+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4444

4545
from google.cloud.kms_inventory_v1.services.key_tracking_service import pagers
4646
from google.cloud.kms_inventory_v1.types import key_tracking_service
@@ -283,7 +283,7 @@ async def sample_get_protected_resources_summary():
283283
This corresponds to the ``name`` field
284284
on the ``request`` instance; if ``request`` is provided, this
285285
should not be set.
286-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
286+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
287287
should be retried.
288288
timeout (float): The timeout for this request.
289289
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -401,7 +401,7 @@ async def sample_search_protected_resources():
401401
This corresponds to the ``crypto_key`` field
402402
on the ``request`` instance; if ``request`` is provided, this
403403
should not be set.
404-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
404+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
405405
should be retried.
406406
timeout (float): The timeout for this request.
407407
metadata (Sequence[Tuple[str, str]]): Strings which should be

‎packages/google-cloud-kms-inventory/kms-inventory-v1-py.tar.gz

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/kms-inventory-v1-py.tar.gz
Whitespace-only changes.

‎packages/google-cloud-kms-inventory/noxfile.py

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/noxfile.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929

3030
BLACK_VERSION = "black[jupyter]==23.7.0"
3131
ISORT_VERSION = "isort==5.11.0"
32+
3233
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3334

35+
3436
DEFAULT_PYTHON_VERSION = "3.10"
3537

36-
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
38+
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
3739
UNIT_TEST_STANDARD_DEPENDENCIES = [
3840
"mock",
3941
"asyncmock",
@@ -47,7 +49,7 @@
4749
UNIT_TEST_EXTRAS: List[str] = []
4850
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
4951

50-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11"]
52+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"]
5153
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5254
"mock",
5355
"pytest",
@@ -89,6 +91,7 @@ def lint(session):
8991
"--check",
9092
*LINT_PATHS,
9193
)
94+
9295
session.run("flake8", "google", "tests")
9396

9497

@@ -336,7 +339,7 @@ def docfx(session):
336339
)
337340

338341

339-
@nox.session(python="3.11")
342+
@nox.session(python="3.12")
340343
def prerelease_deps(session):
341344
"""Run all tests with prerelease versions of dependencies installed."""
342345

‎packages/google-cloud-kms-inventory/setup.py

Copy file name to clipboardExpand all lines: packages/google-cloud-kms-inventory/setup.py
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616
import io
1717
import os
18+
import re
1819

1920
import setuptools # type: ignore
2021

@@ -25,12 +26,14 @@
2526

2627
description = "Google Cloud Kms Inventory API client library"
2728

28-
version = {}
29+
version = None
30+
2931
with open(
3032
os.path.join(package_root, "google/cloud/kms_inventory/gapic_version.py")
3133
) as fp:
32-
exec(fp.read(), version)
33-
version = version["__version__"]
34+
version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read())
35+
assert len(version_candidates) == 1
36+
version = version_candidates[0]
3437

3538
if version[0] == "0":
3639
release_status = "Development Status :: 4 - Beta"
@@ -43,7 +46,7 @@
4346
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4447
"google-cloud-kms >= 2.3.0, <3.0.0dev",
4548
]
46-
url = "https://github.com/googleapis/google-cloud-python"
49+
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-kms-inventory"
4750

4851
package_root = os.path.abspath(os.path.dirname(__file__))
4952

@@ -53,12 +56,10 @@
5356

5457
packages = [
5558
package
56-
for package in setuptools.PEP420PackageFinder.find()
59+
for package in setuptools.find_namespace_packages()
5760
if package.startswith("google")
5861
]
5962

60-
namespaces = ["google", "google.cloud"]
61-
6263
setuptools.setup(
6364
name=name,
6465
version=version,
@@ -79,13 +80,13 @@
7980
"Programming Language :: Python :: 3.9",
8081
"Programming Language :: Python :: 3.10",
8182
"Programming Language :: Python :: 3.11",
83+
"Programming Language :: Python :: 3.12",
8284
"Operating System :: OS Independent",
8385
"Topic :: Internet",
8486
],
8587
platforms="Posix; MacOS X; Windows",
8688
packages=packages,
8789
python_requires=">=3.7",
88-
namespace_packages=namespaces,
8990
install_requires=dependencies,
9091
include_package_data=True,
9192
zip_safe=False,

‎packages/google-cloud-language/CONTRIBUTING.rst

Copy file name to clipboardExpand all lines: packages/google-cloud-language/CONTRIBUTING.rst
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
25+
3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7272

7373
- To run a single unit test::
7474

75-
$ nox -s unit-3.11 -- -k <name of test>
75+
$ nox -s unit-3.12 -- -k <name of test>
7676

7777

7878
.. note::
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system-3.11 -- -k <name of test>
146+
$ nox -s system-3.12 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
151+
System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local
@@ -226,12 +226,14 @@ We support:
226226
- `Python 3.9`_
227227
- `Python 3.10`_
228228
- `Python 3.11`_
229+
- `Python 3.12`_
229230

230231
.. _Python 3.7: https://docs.python.org/3.7/
231232
.. _Python 3.8: https://docs.python.org/3.8/
232233
.. _Python 3.9: https://docs.python.org/3.9/
233234
.. _Python 3.10: https://docs.python.org/3.10/
234235
.. _Python 3.11: https://docs.python.org/3.11/
236+
.. _Python 3.12: https://docs.python.org/3.12/
235237

236238

237239
Supported versions can be found in our ``noxfile.py`` `config`_.

0 commit comments

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