From 70974c252d3fe3b53bce3891cf84df6f87f16d94 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 7 May 2025 11:12:26 +0000 Subject: [PATCH 1/6] build: clean up github action --- .github/workflows/tests.yaml | 107 ++++++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5b2efc098d..0e0615452c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,8 +16,40 @@ concurrency: env: SHOWCASE_VERSION: 0.35.0 PROTOC_VERSION: 3.20.2 + OLDEST_PYTHON: 3.7 + LATEST_STABLE_PYTHON: 3.13 + PRE_RELEASE_PYTHON: 3.14 + ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']" + +permissions: + contents: read jobs: + # `all_python_setup` amd `python_config` are a workaround for a known issue where it's not possible to use environment variables outside of `steps`. + # Some jobs set up a text matrix which is outside of `steps` and environment variables can't be used directly. + # This requires a workaround based on the discussion in: + # https://github.com/actions/runner/issues/2372 + # The limitation is captured here where certain job configurations don't have access to `env` + # https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#context-availability + all_python_setup: + runs-on: ubuntu-latest + outputs: + all_python: ${{ env.ALL_PYTHON }} + steps: + - name: Set up all python + id: all_python + run: | + echo 'all_python={{ "${{ env.ALL_PYTHON }}" }}' + python_config: + runs-on: ubuntu-latest + outputs: + oldest_python: ${{ env.OLDEST_PYTHON }} + latest_stable_python: ${{ env.LATEST_STABLE_PYTHON }} + steps: + - name: Print env variables for `python_config` + run: | + echo 'oldest_python={{ "${{ env.OLDEST_PYTHON }}" }}' + echo 'latest_stable_python={{ "${{ env.LATEST_STABLE_PYTHON }}" }}' docs: runs-on: ubuntu-latest steps: @@ -34,11 +66,15 @@ jobs: - name: Build the documentation. run: nox -s docs mypy: + needs: all_python_setup strategy: matrix: # Run mypy on all of the supported python versions listed in setup.py # https://github.com/python/mypy/blob/master/setup.py - python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }} + exclude: + # Remove once https://github.com/googleapis/gapic-generator-python/issues/2303 is fixed + - python: '3.7' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -52,11 +88,12 @@ jobs: - name: Check type annotations. run: nox -s mypy-${{ matrix.python }} showcase: + needs: python_config strategy: # Run showcase tests on the lowest and highest supported runtimes matrix: # TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `showcase_w_rest_async` target when async rest is GA. - python: ["3.7", "3.13"] + python: ["${{ needs.python_config.outputs.oldest_python }}", "${{ needs.python_config.outputs.latest_stable_python }}"] target: [showcase, showcase_w_rest_async] logging_scope: ["", "google"] @@ -111,10 +148,10 @@ jobs: run: | sudo mkdir -p /tmp/workspace/tests/cert/ sudo chown -R ${USER} /tmp/workspace/ - - name: Set up Python "3.13" + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Copy mtls files run: cp tests/cert/mtls.* /tmp/workspace/tests/cert/ @@ -145,9 +182,10 @@ jobs: nox -s ${{ matrix.target }} # TODO(yon-mg): add compute unit tests showcase-unit: + needs: all_python_setup strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }} # TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `_w_rest_async` variant when async rest is GA. variant: ['', _alternative_templates, _mixins, _alternative_templates_mixins, _w_rest_async] logging_scope: ["", "google"] @@ -185,10 +223,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python "3.13" + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Install system dependencies. run: | @@ -213,10 +251,10 @@ jobs: variant: ['', _alternative_templates] steps: - uses: actions/checkout@v4 - - name: Set up Python "3.13" + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Install system dependencies. run: | @@ -235,13 +273,14 @@ jobs: - name: Typecheck the generated output. run: nox -s showcase_mypy${{ matrix.variant }} snippetgen: + needs: all_python_setup runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python "3.13" + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Install system dependencies. run: | @@ -252,10 +291,10 @@ jobs: - name: Check autogenerated snippets. run: nox -s snippetgen unit: + needs: all_python_setup strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] - + python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }} # TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed. # Use ubuntu-22.04 until Python 3.7 is removed from the test matrix runs-on: ubuntu-22.04 @@ -264,7 +303,7 @@ jobs: - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: "${{ matrix.python }}" cache: 'pip' - name: Install pandoc run: | @@ -276,9 +315,10 @@ jobs: - name: Run unit tests. run: nox -s unit-${{ matrix.python }} fragment: + needs: all_python_setup strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }} variant: ['', _alternative_templates] # TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed. @@ -289,7 +329,7 @@ jobs: - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: "${{ matrix.python }}" cache: 'pip' - name: Install pandoc run: | @@ -333,29 +373,29 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: ${{ env.LATEST_STABLE_PYTHON }} 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.13 blacken lint - nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-3.13 blacken lint - nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-3.13 blacken lint - nox -f tests/integration/goldens/logging/noxfile.py -s mypy-3.13 blacken lint - nox -f tests/integration/goldens/redis/noxfile.py -s mypy-3.13 blacken lint + nox -f tests/integration/goldens/asset/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint + nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint + nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint + nox -f tests/integration/goldens/logging/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint + nox -f tests/integration/goldens/redis/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint goldens-unit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Install nox. run: | @@ -365,19 +405,20 @@ jobs: # in order to run unit tests # See https://github.com/googleapis/gapic-generator-python/issues/1806 run: | - nox -f tests/integration/goldens/credentials/noxfile.py -s unit-3.13 - nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-3.13 - nox -f tests/integration/goldens/logging/noxfile.py -s unit-3.13 - nox -f tests/integration/goldens/redis/noxfile.py -s unit-3.13 + nox -f tests/integration/goldens/credentials/noxfile.py -s unit-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/logging/noxfile.py -s unit-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/redis/noxfile.py -s unit-${{ env.LATEST_STABLE_PYTHON }} goldens-prerelease: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.13 + - name: Set up Python ${{ env.PRE_RELEASE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.PRE_RELEASE_PYTHON }}" cache: 'pip' + allow-prereleases: true - name: Install nox. run: | python -m pip install nox @@ -394,10 +435,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python "3.13" + - name: Set up Python ${{ env.LATEST_STABLE_PYTHON }} uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: "${{ env.LATEST_STABLE_PYTHON }}" cache: 'pip' - name: Install nox. run: | From 13f3a5203722605e99d26c1c4fbae60816a7691b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 7 May 2025 15:35:04 +0000 Subject: [PATCH 2/6] add python 3.14 --- .github/workflows/tests.yaml | 7 +++++-- gapic/templates/noxfile.py.j2 | 18 ++++++++++++------ noxfile.py | 3 ++- tests/integration/goldens/asset/noxfile.py | 18 ++++++++++++------ .../integration/goldens/credentials/noxfile.py | 18 ++++++++++++------ tests/integration/goldens/eventarc/noxfile.py | 18 ++++++++++++------ tests/integration/goldens/logging/noxfile.py | 18 ++++++++++++------ .../goldens/logging_internal/noxfile.py | 18 ++++++++++++------ tests/integration/goldens/redis/noxfile.py | 18 ++++++++++++------ .../goldens/redis_selective/noxfile.py | 18 ++++++++++++------ 10 files changed, 103 insertions(+), 51 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0e0615452c..e57dac7f0c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,7 +19,7 @@ env: OLDEST_PYTHON: 3.7 LATEST_STABLE_PYTHON: 3.13 PRE_RELEASE_PYTHON: 3.14 - ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']" + ALL_PYTHON: "['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']" permissions: contents: read @@ -83,6 +83,7 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install nox. run: python -m pip install nox - name: Check type annotations. @@ -200,6 +201,7 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install system dependencies. run: | sudo apt-get update @@ -305,6 +307,7 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install pandoc run: | sudo apt-get update @@ -320,7 +323,6 @@ jobs: matrix: python: ${{ fromJSON(needs.all_python_setup.outputs.all_python) }} variant: ['', _alternative_templates] - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed. # Use ubuntu-22.04 until Python 3.7 is removed from the test matrix runs-on: ubuntu-22.04 @@ -331,6 +333,7 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install pandoc run: | sudo apt-get update diff --git a/gapic/templates/noxfile.py.j2 b/gapic/templates/noxfile.py.j2 index 35a19afdda..b601e5b151 100644 --- a/gapic/templates/noxfile.py.j2 +++ b/gapic/templates/noxfile.py.j2 @@ -29,9 +29,11 @@ ALL_PYTHON = [ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -51,7 +53,7 @@ UNIT_TEST_DEPENDENCIES: List[str] = [] UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -223,7 +225,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -231,7 +235,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -425,7 +429,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -438,7 +442,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/noxfile.py b/noxfile.py index 117ca47c5e..01ca50269e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -44,9 +44,10 @@ "3.11", "3.12", "3.13", + "3.14", ) -NEWEST_PYTHON = ALL_PYTHON[-1] +NEWEST_PYTHON = ALL_PYTHON[-2] @nox.session(python=ALL_PYTHON) diff --git a/tests/integration/goldens/asset/noxfile.py b/tests/integration/goldens/asset/noxfile.py index 49691dd51e..aade8c8199 100755 --- a/tests/integration/goldens/asset/noxfile.py +++ b/tests/integration/goldens/asset/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/credentials/noxfile.py b/tests/integration/goldens/credentials/noxfile.py index 442d98c88f..a369c03ba8 100755 --- a/tests/integration/goldens/credentials/noxfile.py +++ b/tests/integration/goldens/credentials/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/eventarc/noxfile.py b/tests/integration/goldens/eventarc/noxfile.py index f7d75738e4..2046f263cc 100755 --- a/tests/integration/goldens/eventarc/noxfile.py +++ b/tests/integration/goldens/eventarc/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/logging/noxfile.py b/tests/integration/goldens/logging/noxfile.py index 18f1f2bc16..0921c115e1 100755 --- a/tests/integration/goldens/logging/noxfile.py +++ b/tests/integration/goldens/logging/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/logging_internal/noxfile.py b/tests/integration/goldens/logging_internal/noxfile.py index 18f1f2bc16..0921c115e1 100755 --- a/tests/integration/goldens/logging_internal/noxfile.py +++ b/tests/integration/goldens/logging_internal/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/redis/noxfile.py b/tests/integration/goldens/redis/noxfile.py index 89ab6bcec9..e577fcbe75 100755 --- a/tests/integration/goldens/redis/noxfile.py +++ b/tests/integration/goldens/redis/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies diff --git a/tests/integration/goldens/redis_selective/noxfile.py b/tests/integration/goldens/redis_selective/noxfile.py index 89ab6bcec9..e577fcbe75 100755 --- a/tests/integration/goldens/redis_selective/noxfile.py +++ b/tests/integration/goldens/redis_selective/noxfile.py @@ -36,9 +36,11 @@ "3.11", "3.12", "3.13", + "3.14", ] -DEFAULT_PYTHON_VERSION = ALL_PYTHON[-1] +DEFAULT_PYTHON_VERSION = ALL_PYTHON[-2] +PRE_RELEASE_PYTHON = ALL_PYTHON[-1] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -58,7 +60,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON SYSTEM_TEST_STANDARD_DEPENDENCIES = [ "mock", "pytest", @@ -222,7 +224,9 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation): # Install all test dependencies, then install this package in-place. - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") constraints_path = str( @@ -230,7 +234,7 @@ def unit(session, protobuf_implementation): ) install_unittest_dependencies(session, "-c", constraints_path) - # TODO(https://github.com/googleapis/synthtool/issues/1976): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. # The 'cpp' implementation requires Protobuf<4. if protobuf_implementation == "cpp": @@ -419,7 +423,7 @@ def docfx(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=PRE_RELEASE_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb", "cpp"], @@ -432,7 +436,9 @@ def prerelease_deps(session, protobuf_implementation): `pip install --pre `. """ - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2388): + # Remove this check once support for Protobuf 3.x is dropped. + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"): session.skip("cpp implementation is not supported in python 3.11+") # Install all dependencies From d0775d2a112a9087eed239163274fff25a26faf1 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 26 Sep 2025 17:41:16 +0000 Subject: [PATCH 3/6] add constraints file --- .../templates/testing/constraints-3.14.txt.j2 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gapic/templates/testing/constraints-3.14.txt.j2 diff --git a/gapic/templates/testing/constraints-3.14.txt.j2 b/gapic/templates/testing/constraints-3.14.txt.j2 new file mode 100644 index 0000000000..ef07e24064 --- /dev/null +++ b/gapic/templates/testing/constraints-3.14.txt.j2 @@ -0,0 +1,20 @@ +{% from '_pypi_packages.j2' import pypi_packages %} +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 +{% for package_tuple, package_info in pypi_packages.items() %} +{# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #} +{% if api.naming.warehouse_package_name != package_info.package_name %} +{% if api.requires_package(package_tuple) %} +{{ package_info.package_name }}>={{ (package_info.upper_bound.split(".")[0] | int) - 1 }} +{% endif %} +{% endif %} +{% endfor %} From 7e02b53ebfca6cb0a948bae8f4824a11dbf40c21 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 26 Sep 2025 18:23:33 +0000 Subject: [PATCH 4/6] See https://github.com/googleapis/gapic-generator-python/issues/2446 --- gapic/schema/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gapic/schema/api.py b/gapic/schema/api.py index 46fe9d3fb5..f3e83af61f 100644 --- a/gapic/schema/api.py +++ b/gapic/schema/api.py @@ -935,11 +935,13 @@ def enforce_valid_library_settings( # Check to see if selective gapic generation methods are valid. selective_gapic_errors = {} + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2446): + # Workaround issue in Python 3.14 related to code coverage by adding `# pragma: no branch` for ( method_name ) in ( library_settings.python_settings.common.selective_gapic_generation.methods - ): + ): # pragma: no branch if method_name not in self.all_methods: selective_gapic_errors[method_name] = "Method does not exist." elif not method_name.startswith(library_settings.version): From 5a4c20481720e520104cd183e2d7368179c3a029 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 26 Sep 2025 18:33:00 +0000 Subject: [PATCH 5/6] fix build --- gapic/schema/api.py | 14 +++++++------- .../goldens/asset/testing/constraints-3.14.txt | 14 ++++++++++++++ .../credentials/testing/constraints-3.14.txt | 11 +++++++++++ .../goldens/eventarc/testing/constraints-3.14.txt | 12 ++++++++++++ .../goldens/logging/testing/constraints-3.14.txt | 11 +++++++++++ .../logging_internal/testing/constraints-3.14.txt | 11 +++++++++++ .../goldens/redis/testing/constraints-3.14.txt | 11 +++++++++++ .../redis_selective/testing/constraints-3.14.txt | 11 +++++++++++ 8 files changed, 88 insertions(+), 7 deletions(-) create mode 100755 tests/integration/goldens/asset/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/credentials/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/eventarc/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/logging/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/logging_internal/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/redis/testing/constraints-3.14.txt create mode 100755 tests/integration/goldens/redis_selective/testing/constraints-3.14.txt diff --git a/gapic/schema/api.py b/gapic/schema/api.py index f3e83af61f..05fb1a2fa5 100644 --- a/gapic/schema/api.py +++ b/gapic/schema/api.py @@ -941,13 +941,13 @@ def enforce_valid_library_settings( method_name ) in ( library_settings.python_settings.common.selective_gapic_generation.methods - ): # pragma: no branch + ): # pragma: no branch if method_name not in self.all_methods: selective_gapic_errors[method_name] = "Method does not exist." elif not method_name.startswith(library_settings.version): - selective_gapic_errors[method_name] = ( - "Mismatched version for method." - ) + selective_gapic_errors[ + method_name + ] = "Mismatched version for method." if selective_gapic_errors: all_errors[library_settings.version] = [ @@ -1032,9 +1032,9 @@ def has_operations_mixin(self) -> bool: def _has_iam_overrides(self) -> bool: if not self.has_iam_mixin: return False - iam_mixin_methods: Dict[str, MethodDescriptorProto] = ( - self._get_methods_from_service(iam_policy_pb2) - ) + iam_mixin_methods: Dict[ + str, MethodDescriptorProto + ] = self._get_methods_from_service(iam_policy_pb2) for _, s in self.services.items(): for m_name in iam_mixin_methods: if m_name in s.methods: diff --git a/tests/integration/goldens/asset/testing/constraints-3.14.txt b/tests/integration/goldens/asset/testing/constraints-3.14.txt new file mode 100755 index 0000000000..763099d824 --- /dev/null +++ b/tests/integration/goldens/asset/testing/constraints-3.14.txt @@ -0,0 +1,14 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 +google-cloud-access-context-manager>=0 +google-cloud-os-config>=1 +grpc-google-iam-v1>=0 diff --git a/tests/integration/goldens/credentials/testing/constraints-3.14.txt b/tests/integration/goldens/credentials/testing/constraints-3.14.txt new file mode 100755 index 0000000000..c20a77817c --- /dev/null +++ b/tests/integration/goldens/credentials/testing/constraints-3.14.txt @@ -0,0 +1,11 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 diff --git a/tests/integration/goldens/eventarc/testing/constraints-3.14.txt b/tests/integration/goldens/eventarc/testing/constraints-3.14.txt new file mode 100755 index 0000000000..2010e549cc --- /dev/null +++ b/tests/integration/goldens/eventarc/testing/constraints-3.14.txt @@ -0,0 +1,12 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 +grpc-google-iam-v1>=0 diff --git a/tests/integration/goldens/logging/testing/constraints-3.14.txt b/tests/integration/goldens/logging/testing/constraints-3.14.txt new file mode 100755 index 0000000000..c20a77817c --- /dev/null +++ b/tests/integration/goldens/logging/testing/constraints-3.14.txt @@ -0,0 +1,11 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 diff --git a/tests/integration/goldens/logging_internal/testing/constraints-3.14.txt b/tests/integration/goldens/logging_internal/testing/constraints-3.14.txt new file mode 100755 index 0000000000..c20a77817c --- /dev/null +++ b/tests/integration/goldens/logging_internal/testing/constraints-3.14.txt @@ -0,0 +1,11 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 diff --git a/tests/integration/goldens/redis/testing/constraints-3.14.txt b/tests/integration/goldens/redis/testing/constraints-3.14.txt new file mode 100755 index 0000000000..c20a77817c --- /dev/null +++ b/tests/integration/goldens/redis/testing/constraints-3.14.txt @@ -0,0 +1,11 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 diff --git a/tests/integration/goldens/redis_selective/testing/constraints-3.14.txt b/tests/integration/goldens/redis_selective/testing/constraints-3.14.txt new file mode 100755 index 0000000000..c20a77817c --- /dev/null +++ b/tests/integration/goldens/redis_selective/testing/constraints-3.14.txt @@ -0,0 +1,11 @@ +# We use the constraints file for the latest Python version +# (currently this file) to check that the latest +# major versions of dependencies are supported in setup.py. +# List all library dependencies and extras in this file. +# Require the latest major version be installed for each dependency. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# Then this file should have google-cloud-foo>=1 +google-api-core>=2 +google-auth>=2 +proto-plus>=1 +protobuf>=6 From d175f0b328229893f8207b7675b62f39451eb3ac Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 26 Sep 2025 18:35:20 +0000 Subject: [PATCH 6/6] lint --- gapic/schema/api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gapic/schema/api.py b/gapic/schema/api.py index 05fb1a2fa5..2c01b07363 100644 --- a/gapic/schema/api.py +++ b/gapic/schema/api.py @@ -945,9 +945,9 @@ def enforce_valid_library_settings( if method_name not in self.all_methods: selective_gapic_errors[method_name] = "Method does not exist." elif not method_name.startswith(library_settings.version): - selective_gapic_errors[ - method_name - ] = "Mismatched version for method." + selective_gapic_errors[method_name] = ( + "Mismatched version for method." + ) if selective_gapic_errors: all_errors[library_settings.version] = [ @@ -1032,9 +1032,9 @@ def has_operations_mixin(self) -> bool: def _has_iam_overrides(self) -> bool: if not self.has_iam_mixin: return False - iam_mixin_methods: Dict[ - str, MethodDescriptorProto - ] = self._get_methods_from_service(iam_policy_pb2) + iam_mixin_methods: Dict[str, MethodDescriptorProto] = ( + self._get_methods_from_service(iam_policy_pb2) + ) for _, s in self.services.items(): for m_name in iam_mixin_methods: if m_name in s.methods: