Skip to content
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

feat: add support for python 3.11 #1555

Merged
merged 4 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ branchProtectionRules:
- 'showcase-unit (3.8)'
- 'showcase-unit (3.9)'
- 'showcase-unit (3.10)'
- 'showcase-unit (3.11)'
- 'showcase-unit (3.7, _alternative_templates)'
- 'showcase-unit (3.8, _alternative_templates)'
- 'showcase-unit (3.9, _alternative_templates)'
- 'showcase-unit (3.10, _alternative_templates)'
- 'showcase-unit (3.11, _alternative_templates)'
- 'showcase-unit (3.7, _alternative_templates_mixins)'
- 'showcase-unit (3.8, _alternative_templates_mixins)'
- 'showcase-unit (3.9, _alternative_templates_mixins)'
- 'showcase-unit (3.10, _alternative_templates_mixins)'
- 'showcase-unit (3.11, _alternative_templates_mixins)'
- 'showcase-unit (3.7, _mixins)'
- 'showcase-unit (3.8, _mixins)'
- 'showcase-unit (3.9, _mixins)'
- 'showcase-unit (3.10, _mixins)'
- 'showcase-unit (3.11, _mixins)'
- 'showcase-unit-add-iam-methods'
- 'integration'
- 'goldens-lint'
Expand All @@ -41,14 +45,17 @@ branchProtectionRules:
- 'unit (3.8)'
- 'unit (3.9)'
- 'unit (3.10)'
- 'unit (3.11)'
- 'fragment (3.7)'
- 'fragment (3.8)'
- 'fragment (3.9)'
- 'fragment (3.10)'
- 'fragment (3.11)'
- 'fragment (3.7, _alternative_templates)'
- 'fragment (3.8, _alternative_templates)'
- 'fragment (3.9, _alternative_templates)'
- 'fragment (3.10, _alternative_templates)'
- 'fragment (3.11, _alternative_templates)'
- 'OwlBot Post Processor'
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: 'pip'
- name: Install nox.
run: python -m pip install nox
Expand All @@ -36,10 +36,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install nox.
run: python -m pip install nox
Expand All @@ -52,10 +52,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand Down Expand Up @@ -95,10 +95,10 @@ jobs:
run: |
sudo mkdir -p /tmp/workspace/tests/cert/
sudo chown -R ${USER} /tmp/workspace/
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Copy mtls files
run: cp tests/cert/mtls.* /tmp/workspace/tests/cert/
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
showcase-unit:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
variant: ['', _alternative_templates, _mixins, _alternative_templates_mixins]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -161,10 +161,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand All @@ -189,10 +189,10 @@ jobs:
variant: ['', _alternative_templates]
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand All @@ -214,10 +214,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand All @@ -230,7 +230,7 @@ jobs:
unit:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -251,7 +251,7 @@ jobs:
fragment:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
variant: ['', _alternative_templates]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -303,10 +303,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install nox.
run: |
Expand All @@ -322,10 +322,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.10"
- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: 'pip'
- name: Install autopep8
run: |
Expand Down
1 change: 1 addition & 0 deletions gapic/ads-templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ALL_PYTHON = [
"3.8",
"3.9",
"3.10",
"3.11",
]

@nox.session(python=ALL_PYTHON)
Expand Down
12 changes: 7 additions & 5 deletions gapic/ads-templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ setuptools.setup(
install_requires=(
{# TODO(dovs): remove when 1.x deprecation is complete #}
{% if 'rest' in opts.transport %}
'google-api-core[grpc] >= 2.10.0, < 3.0.0dev',
"google-api-core[grpc] >= 2.10.0, < 3.0.0dev",
{% else %}
'google-api-core[grpc] >= 1.28.0, < 3.0.0dev',
"google-api-core[grpc] >= 1.28.0, < 3.0.0dev",
{% endif %}
'googleapis-common-protos >= 1.53.0',
'grpcio >= 1.10.0',
'proto-plus >= 1.19.4',
"googleapis-common-protos >= 1.53.0",
"grpcio >= 1.10.0",
"proto-plus >= 1.19.4, <2.0.0dev",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
{% if api.requires_package(('google', 'iam', 'v1')) %}
'grpc-google-iam-v1',
{% endif %}
Expand All @@ -45,6 +46,7 @@ setuptools.setup(
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Internet',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand Down
3 changes: 2 additions & 1 deletion gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ALL_PYTHON = [
"3.8",
"3.9",
"3.10",
"3.11",
]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -25,7 +26,7 @@ PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], e

BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"]
DEFAULT_PYTHON_VERSION = "3.10"
DEFAULT_PYTHON_VERSION = "3.11"

nox.sessions = [
"unit",
Expand Down
2 changes: 2 additions & 0 deletions gapic/templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ else:
dependencies = [
"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.*",
"proto-plus >= 1.22.0, <2.0.0dev",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
"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",
{# TODO: Remove after https://github.com/googleapis/gapic-generator-python/pull/1240 is merged. #}
{% if api.requires_package(('google', 'iam', 'v1')) or opts.add_iam_methods or api.has_iam_mixin %}
Expand Down Expand Up @@ -75,6 +76,7 @@ setuptools.setup(
"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",
],
Expand Down
4 changes: 4 additions & 0 deletions gapic/templates/testing/constraints-3.12.txt.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
{% block constraints %}
{% include "testing/_default_constraints.j2" %}
{% endblock %}
3 changes: 2 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"3.8",
"3.9",
"3.10",
"3.11",
)

NEWEST_PYTHON = ALL_PYTHON[-1]
Expand Down Expand Up @@ -411,7 +412,7 @@ def snippetgen(session):
session.run("py.test", "-vv", "tests/snippetgen")


@nox.session(python="3.8")
@nox.session(python="3.9")
def docs(session):
"""Build the docs."""

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pypandoc==1.10
PyYAML==6.0
setuptools==65.6.3
grpc-google-iam-v1==0.12.4
proto-plus==1.22.1
proto-plus==1.22.2
pytest-asyncio==0.20.3
libcst==0.4.9
inflection==0.5.1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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 :: Software Development :: Code Generators",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/goldens/asset/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"3.8",
"3.9",
"3.10",
"3.11",
]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -36,7 +37,7 @@

BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"]
DEFAULT_PYTHON_VERSION = "3.10"
DEFAULT_PYTHON_VERSION = "3.11"

nox.sessions = [
"unit",
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/goldens/asset/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
dependencies = [
"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.*",
"proto-plus >= 1.22.0, <2.0.0dev",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
"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",
'grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev',
]
Expand Down Expand Up @@ -78,6 +79,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",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf
grpc-google-iam-v1
3 changes: 2 additions & 1 deletion tests/integration/goldens/credentials/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"3.8",
"3.9",
"3.10",
"3.11",
]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -36,7 +37,7 @@

BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"]
DEFAULT_PYTHON_VERSION = "3.10"
DEFAULT_PYTHON_VERSION = "3.11"

nox.sessions = [
"unit",
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/goldens/credentials/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
dependencies = [
"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.*",
"proto-plus >= 1.22.0, <2.0.0dev",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
"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",
]
url = "https://github.com/googleapis/python-iam-credentials"
Expand Down Expand Up @@ -77,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",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf
3 changes: 2 additions & 1 deletion tests/integration/goldens/eventarc/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"3.8",
"3.9",
"3.10",
"3.11",
]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -36,7 +37,7 @@

BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"]
DEFAULT_PYTHON_VERSION = "3.10"
DEFAULT_PYTHON_VERSION = "3.11"

nox.sessions = [
"unit",
Expand Down
Loading