From f60f8a8bba9bc7054971e6c5f91c9849aaf645be Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 15 Feb 2023 14:28:04 -0500 Subject: [PATCH] fix: add support for python 3.11 (#403) * fix: drop python 3.7 * fix: add support for python 3.11 * add python 3.11 samples testing as a required check --- .github/sync-repo-settings.yaml | 4 +++- .github/workflows/unittest.yml | 2 +- CONTRIBUTING.rst | 6 ++++-- noxfile.py | 2 +- owlbot.py | 2 +- setup.py | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 97867db8..271a1d4f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -30,8 +30,10 @@ branchProtectionRules: requiredStatusCheckContexts: - 'Kokoro' - 'cla/google' - - 'Samples - Python 3.7' - 'Samples - Python 3.8' + - 'Samples - Python 3.9' + - 'Samples - Python 3.10' + - 'Samples - Python 3.11' - 'Samples - Lint' - 'OwlBot Post Processor' # List of explicit permissions to add (additive only) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 820c4c26..87a4fa3e 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.8', '3.9', '3.10'] + python: ['3.8', '3.9', '3.10', '3.11'] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 67461e4e..2bc07b6a 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.8, 3.9 and 3.10 on both UNIX and Windows. + 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 @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.10 -- -k + $ nox -s unit-3.11 -- -k .. note:: @@ -224,10 +224,12 @@ We support: - `Python 3.8`_ - `Python 3.9`_ - `Python 3.10`_ +- `Python 3.11`_ .. _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`_. diff --git a/noxfile.py b/noxfile.py index 3c80caae..499ae39f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -32,7 +32,7 @@ DEFAULT_PYTHON_VERSION = "3.8" -UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10"] +UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", diff --git a/owlbot.py b/owlbot.py index 82271c43..fd0b063b 100644 --- a/owlbot.py +++ b/owlbot.py @@ -61,7 +61,7 @@ templated_files = gcp.CommonTemplates().py_library( cov_level=96, microgenerator=True, - unit_test_python_versions=["3.8", "3.9", "3.10"], + unit_test_python_versions=["3.8", "3.9", "3.10", "3.11"], versions=gcp.common.detect_versions(path="./google", default_first=True), ) s.move( diff --git a/setup.py b/setup.py index f45311d8..19ab0fa5 100644 --- a/setup.py +++ b/setup.py @@ -78,6 +78,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", "Topic :: Internet", ],