Skip to content

feat: add support for Python 3.11 #1973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 30, 2022
6 changes: 4 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

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

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

- To run a single unit test::

$ nox -s unit-3.10 -- -k <name of test>
$ nox -s unit-3.11 -- -k <name of test>


.. note::
Expand Down Expand Up @@ -225,11 +225,13 @@ We support:
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/


Supported versions can be found in our ``noxfile.py`` `config`_.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ virtualenv <your-env>

## Supported Python Versions

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.
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.

## Unsupported Python Versions

Expand Down
2 changes: 1 addition & 1 deletion googleapiclient/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def positional_wrapper(*args, **kwargs):
if isinstance(max_positional_args, int):
return positional_decorator
else:
args, _, _, defaults = inspect.getargspec(max_positional_args)
args, _, _, defaults, _, _, _ = inspect.getfullargspec(max_positional_args)
return positional(len(args) - len(defaults))(max_positional_args)


Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def format(session):
)


@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
@nox.parametrize(
"oauth2client",
[
Expand Down
4 changes: 3 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library()
templated_files = common.py_library(
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11"],
)

# Copy kokoro configs.
# Docs are excluded as repo docs cannot currently be generated using sphinx.
Expand Down
2 changes: 1 addition & 1 deletion scripts/changesummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _get_discovery_differences(self, filename):
# Split the Key into 2 columns for `Parent` and `Child` in order
# to group keys with the same parents together to summarize the changes
# by parent.
parent_child_df = combined_docs["Key"].str.rsplit(".", 1, expand=True)
parent_child_df = combined_docs["Key"].str.rsplit(".", n=1, expand=True)
# Rename the columns and join them with the combined_docs dataframe.
# If we only have a `Parent` column, it means that the Key doesn't have
# any children.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
Expand Down