Skip to content

Commit 5cd98aa

Browse files
feat: [Many APIs] Add support for Python 3.12 (#12067)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 586460538 Source-Link: googleapis/googleapis@44582d0 Source-Link: googleapis/googleapis-gen@5e7073c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjVlNzA3M2M5ZGU4NDc5MjljNGFlOTdmOGE0NDRjM2ZjYTJkNDVhNmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjVlNzA3M2M5ZGU4NDc5MjljNGFlOTdmOGE0NDRjM2ZjYTJkNDVhNmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiI1ZTcwNzNjOWRlODQ3OTI5YzRhZTk3ZjhhNDQ0YzNmY2EyZDQ1YTZiIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbW1vbi8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRscC8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdzdWl0ZWF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Tg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1vbml0b3JpbmcvLk93bEJvdC55YW1sIiwiaCI6IjVlNzA3M2M5ZGU4NDc5MjljNGFlOTdmOGE0NDRjM2ZjYTJkNDVhNmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmstY29ubmVjdGl2aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI1ZTcwNzNjOWRlODQ3OTI5YzRhZTk3ZjhhNDQ0YzNmY2EyZDQ1YTZiIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmstbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmstc2VjdXJpdHkvLk93bEJvdC55YW1sIiwiaCI6IjVlNzA3M2M5ZGU4NDc5MjljNGFlOTdmOGE0NDRjM2ZjYTJkNDVhNmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5vdGVib29rcy8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 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 <[email protected]>
1 parent 31d043d commit 5cd98aa

File tree

66 files changed

+745
-703
lines changed

Some content is hidden

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

66 files changed

+745
-703
lines changed

packages/google-cloud-common/CONTRIBUTING.rst

Lines changed: 18 additions & 16 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
@@ -35,21 +35,21 @@ Using a Development Checkout
3535
You'll have to create a development environment using a Git checkout:
3636

3737
- While logged into your GitHub account, navigate to the
38-
``python-cloud-common`` `repo`_ on GitHub.
38+
``google-cloud-python`` `repo`_ on GitHub.
3939

40-
- Fork and clone the ``python-cloud-common`` repository to your GitHub account by
40+
- Fork and clone the ``google-cloud-python`` repository to your GitHub account by
4141
clicking the "Fork" button.
4242

43-
- Clone your fork of ``python-cloud-common`` from your GitHub account to your local
43+
- Clone your fork of ``google-cloud-python`` from your GitHub account to your local
4444
computer, substituting your account username and specifying the destination
45-
as ``hack-on-python-cloud-common``. E.g.::
45+
as ``hack-on-google-cloud-python``. E.g.::
4646

4747
$ cd ${HOME}
48-
$ git clone [email protected]:USERNAME/python-cloud-common.git hack-on-python-cloud-common
49-
$ cd hack-on-python-cloud-common
50-
# Configure remotes such that you can pull changes from the googleapis/python-cloud-common
48+
$ git clone [email protected]:USERNAME/google-cloud-python.git hack-on-google-cloud-python
49+
$ cd hack-on-google-cloud-python
50+
# Configure remotes such that you can pull changes from the googleapis/google-cloud-python
5151
# repository into your local repository.
52-
$ git remote add upstream [email protected]:googleapis/python-cloud-common.git
52+
$ git remote add upstream [email protected]:googleapis/google-cloud-python.git
5353
# fetch and merge changes from upstream into main
5454
$ git fetch upstream
5555
$ git merge upstream/main
@@ -60,7 +60,7 @@ repo, from which you can submit a pull request.
6060
To work on the codebase and run the tests, we recommend using ``nox``,
6161
but you can also use a ``virtualenv`` of your own creation.
6262

63-
.. _repo: https://github.com/googleapis/python-cloud-common
63+
.. _repo: https://github.com/googleapis/google-cloud-python
6464

6565
Using ``nox``
6666
=============
@@ -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::
@@ -113,7 +113,7 @@ Coding Style
113113
export GOOGLE_CLOUD_TESTING_BRANCH="main"
114114

115115
By doing this, you are specifying the location of the most up-to-date
116-
version of ``python-cloud-common``. The
116+
version of ``google-cloud-python``. The
117117
remote name ``upstream`` should point to the official ``googleapis``
118118
checkout and the branch should be the default branch on that remote (``main``).
119119

@@ -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
@@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the
209209
``README``. Due to the reStructuredText (``rst``) parser used by
210210
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
211211
instead of
212-
``https://github.com/googleapis/python-cloud-common/blob/main/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/google-cloud-python/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

215215
.. _description on PyPI: https://pypi.org/project/google-cloud-common
@@ -226,17 +226,19 @@ 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`_.
238240

239-
.. _config: https://github.com/googleapis/python-cloud-common/blob/main/packages/google-cloud-common/noxfile.py
241+
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-common/noxfile.py
240242

241243

242244
**********

packages/google-cloud-common/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
html_theme_options = {
157157
"description": "Google Cloud Client Libraries for google-cloud-common",
158158
"github_user": "googleapis",
159-
"github_repo": "python-cloud-common",
159+
"github_repo": "google-cloud-python",
160160
"github_banner": True,
161161
"font_family": "'Roboto', Georgia, sans",
162162
"head_font_family": "'Roboto', Georgia, serif",

packages/google-cloud-common/noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
DEFAULT_PYTHON_VERSION = "3.10"
3737

38-
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"]
3939
UNIT_TEST_STANDARD_DEPENDENCIES = [
4040
"mock",
4141
"asyncmock",
@@ -49,7 +49,7 @@
4949
UNIT_TEST_EXTRAS: List[str] = []
5050
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
5151

52-
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"]
5353
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5454
"mock",
5555
"pytest",
@@ -339,7 +339,7 @@ def docfx(session):
339339
)
340340

341341

342-
@nox.session(python="3.11")
342+
@nox.session(python="3.12")
343343
def prerelease_deps(session):
344344
"""Run all tests with prerelease versions of dependencies installed."""
345345

packages/google-cloud-common/setup.py

Lines changed: 10 additions & 10 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,10 +26,12 @@
2526

2627
description = "Google Cloud Common API client library"
2728

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

3336
if version[0] == "0":
3437
release_status = "Development Status :: 4 - Beta"
@@ -37,11 +40,10 @@
3740

3841
dependencies = [
3942
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
40-
"proto-plus >= 1.22.0, <2.0.0dev",
41-
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
43+
"proto-plus >= 1.22.3, <2.0.0dev",
4244
"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",
4345
]
44-
url = "https://github.com/googleapis/google-cloud-python"
46+
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-common"
4547

4648
package_root = os.path.abspath(os.path.dirname(__file__))
4749

@@ -51,12 +53,10 @@
5153

5254
packages = [
5355
package
54-
for package in setuptools.PEP420PackageFinder.find()
56+
for package in setuptools.find_namespace_packages()
5557
if package.startswith("google")
5658
]
5759

58-
namespaces = ["google", "google.cloud"]
59-
6060
setuptools.setup(
6161
name=name,
6262
version=version,
@@ -77,13 +77,13 @@
7777
"Programming Language :: Python :: 3.9",
7878
"Programming Language :: Python :: 3.10",
7979
"Programming Language :: Python :: 3.11",
80+
"Programming Language :: Python :: 3.12",
8081
"Operating System :: OS Independent",
8182
"Topic :: Internet",
8283
],
8384
platforms="Posix; MacOS X; Windows",
8485
packages=packages,
8586
python_requires=">=3.7",
86-
namespace_packages=namespaces,
8787
install_requires=dependencies,
8888
include_package_data=True,
8989
zip_safe=False,

packages/google-cloud-common/testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
77
google-api-core==1.34.0
8-
proto-plus==1.22.0
8+
proto-plus==1.22.3
99
protobuf==3.19.5

packages/google-cloud-dlp/CONTRIBUTING.rst

Lines 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-dlp/google/cloud/dlp/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "3.13.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dlp/google/cloud/dlp_v2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "3.13.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

0 commit comments

Comments
 (0)