Skip to content

Commit 1106672

Browse files
ziegenbergpartheagcf-owl-bot[bot]
authored
feat: add support for Python 3.11 (#1973)
* feat: add support for Python 3.11 Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at> * fix: FutureWarning pandas In a future version of pandas all arguments of StringMethods.rsplit except for the argument 'pat' will be keyword-only. Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at> * fix: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0 With Python 3.11 `inspect.getargspec()` was removed. The recommendation is to use `inspect.getfullargspec()`. See: https://docs.python.org/3.10/library/inspect.html#inspect.getargspec > Deprecated since version 3.0: Use `getfullargspec()` for an updated API > that is usually a drop-in replacement, but also correctly handles > function annotations and keyword-only parameters. Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at> * add python 3.11 in template generation * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Remove python 3.11 samples check Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 03f4753 commit 1106672

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

Diff for: CONTRIBUTING.rst

+4-2
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 and 3.10 on both UNIX and Windows.
25+
3.7, 3.8, 3.9, 3.10 and 3.11 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.10 -- -k <name of test>
75+
$ nox -s unit-3.11 -- -k <name of test>
7676

7777

7878
.. note::
@@ -225,11 +225,13 @@ We support:
225225
- `Python 3.8`_
226226
- `Python 3.9`_
227227
- `Python 3.10`_
228+
- `Python 3.11`_
228229

229230
.. _Python 3.7: https://docs.python.org/3.7/
230231
.. _Python 3.8: https://docs.python.org/3.8/
231232
.. _Python 3.9: https://docs.python.org/3.9/
232233
.. _Python 3.10: https://docs.python.org/3.10/
234+
.. _Python 3.11: https://docs.python.org/3.11/
233235

234236

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

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ virtualenv <your-env>
9797

9898
## Supported Python Versions
9999

100-
Python 3.7, 3.8, 3.9 and 3.10 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions.
100+
Python 3.7, 3.8, 3.9, 3.10 and 3.11 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions.
101101

102102
## Unsupported Python Versions
103103

Diff for: googleapiclient/_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def positional_wrapper(*args, **kwargs):
134134
if isinstance(max_positional_args, int):
135135
return positional_decorator
136136
else:
137-
args, _, _, defaults = inspect.getargspec(max_positional_args)
137+
args, _, _, defaults, _, _, _ = inspect.getfullargspec(max_positional_args)
138138
return positional(len(args) - len(defaults))(max_positional_args)
139139

140140

Diff for: noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def format(session):
8080
)
8181

8282

83-
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
83+
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
8484
@nox.parametrize(
8585
"oauth2client",
8686
[

Diff for: owlbot.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
# ----------------------------------------------------------------------------
2424
# Add templated files
2525
# ----------------------------------------------------------------------------
26-
templated_files = common.py_library()
26+
templated_files = common.py_library(
27+
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11"],
28+
)
2729

2830
# Copy kokoro configs.
2931
# Docs are excluded as repo docs cannot currently be generated using sphinx.

Diff for: scripts/changesummary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _get_discovery_differences(self, filename):
154154
# Split the Key into 2 columns for `Parent` and `Child` in order
155155
# to group keys with the same parents together to summarize the changes
156156
# by parent.
157-
parent_child_df = combined_docs["Key"].str.rsplit(".", 1, expand=True)
157+
parent_child_df = combined_docs["Key"].str.rsplit(".", n=1, expand=True)
158158
# Rename the columns and join them with the combined_docs dataframe.
159159
# If we only have a `Parent` column, it means that the Key doesn't have
160160
# any children.

Diff for: setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"Programming Language :: Python :: 3.8",
8181
"Programming Language :: Python :: 3.9",
8282
"Programming Language :: Python :: 3.10",
83+
"Programming Language :: Python :: 3.11",
8384
"Development Status :: 5 - Production/Stable",
8485
"Intended Audience :: Developers",
8586
"License :: OSI Approved :: Apache Software License",

0 commit comments

Comments
 (0)