Skip to content

Commit

Permalink
feat: add support for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmayr committed Oct 24, 2023
1 parent 45f18a6 commit ee83359
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ branchProtectionRules:
- 'showcase-unit (3.9)'
- 'showcase-unit (3.10)'
- 'showcase-unit (3.11)'
- 'showcase-unit (3.12)'
- 'showcase-unit (3.7, _alternative_templates)'
- 'showcase-unit (3.8, _alternative_templates)'
- 'showcase-unit (3.9, _alternative_templates)'
Expand All @@ -31,11 +32,13 @@ branchProtectionRules:
- 'showcase-unit (3.9, _alternative_templates_mixins)'
- 'showcase-unit (3.10, _alternative_templates_mixins)'
- 'showcase-unit (3.11, _alternative_templates_mixins)'
- 'showcase-unit (3.12, _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 (3.12, _mixins)'
- 'showcase-unit-add-iam-methods'
- 'integration'
- 'goldens-lint'
Expand All @@ -46,16 +49,19 @@ branchProtectionRules:
- 'unit (3.9)'
- 'unit (3.10)'
- 'unit (3.11)'
- 'unit (3.12)'
- 'fragment (3.7)'
- 'fragment (3.8)'
- 'fragment (3.9)'
- 'fragment (3.10)'
- 'fragment (3.11)'
- 'fragment (3.12)'
- '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)'
- 'fragment (3.12, _alternative_templates)'
- 'OwlBot Post Processor'
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
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@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
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.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
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", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
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@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand All @@ -189,10 +189,10 @@ jobs:
variant: ['', _alternative_templates]
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip'
- name: Install system dependencies.
run: |
Expand All @@ -214,10 +214,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
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", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -251,7 +251,7 @@ jobs:
fragment:
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
variant: ['', _alternative_templates]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -303,29 +303,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip'
- name: Install nox.
run: |
python -m pip install nox
- name: Run blacken and lint on the generated output.
run: |
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-3.11 blacken lint_setup_py lint
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-3.11 blacken lint_setup_py lint
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-3.11 blacken lint_setup_py lint
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-3.11 blacken lint_setup_py lint
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-3.11 blacken lint_setup_py lint
nox -f tests/integration/goldens/asset/noxfile.py -s mypy-3.12 blacken lint_setup_py lint
nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-3.12 blacken lint_setup_py lint
nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-3.12 blacken lint_setup_py lint
nox -f tests/integration/goldens/logging/noxfile.py -s mypy-3.12 blacken lint_setup_py lint
nox -f tests/integration/goldens/redis/noxfile.py -s mypy-3.12 blacken lint_setup_py lint
style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python "3.11"
- name: Set up Python "3.12"
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip'
- name: Install autopep8
run: |
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ py_binary(
requirement("PyYAML"),
requirement("grpc-google-iam-v1"),
],
)
)
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ switched_rules_by_language(
name = "com_google_googleapis_imports",
gapic = True,
grpc = True,
)
)
1 change: 1 addition & 0 deletions gapic/ads-templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ALL_PYTHON = [
"3.9",
"3.10",
"3.11",
"3.12",
]

@nox.session(python=ALL_PYTHON)
Expand Down
1 change: 1 addition & 0 deletions gapic/ads-templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ setuptools.setup(
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'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 @@ -17,6 +17,7 @@ ALL_PYTHON = [
"3.9",
"3.10",
"3.11",
"3.12"
]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -26,7 +27,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.11"
DEFAULT_PYTHON_VERSION = "3.12"

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions gapic/templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ setuptools.setup(
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
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 @@ -28,6 +28,7 @@
"3.9",
"3.10",
"3.11",
"3.12"
]

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

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

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/goldens/asset/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/goldens/credentials/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"3.9",
"3.10",
"3.11",
"3.12"
]

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

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

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/goldens/credentials/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/goldens/eventarc/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"3.9",
"3.10",
"3.11",
"3.12"
]

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

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

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/goldens/eventarc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/goldens/logging/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"3.9",
"3.10",
"3.11",
"3.12"
]

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

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

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/goldens/logging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/goldens/redis/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"3.9",
"3.10",
"3.11",
"3.12"
]

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

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

nox.sessions = [
"unit",
Expand Down
1 change: 1 addition & 0 deletions tests/integration/goldens/redis/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down

0 comments on commit ee83359

Please sign in to comment.