diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5b2efc098d..e57dac7f0c 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', '3.14']" + +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 @@ -47,16 +83,18 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install nox. run: python -m pip install nox - 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 +149,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 +183,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"] @@ -162,6 +201,7 @@ jobs: with: python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install system dependencies. run: | sudo apt-get update @@ -185,10 +225,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 +253,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 +275,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 +293,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,8 +305,9 @@ jobs: - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install pandoc run: | sudo apt-get update @@ -276,11 +318,11 @@ 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. # Use ubuntu-22.04 until Python 3.7 is removed from the test matrix runs-on: ubuntu-22.04 @@ -289,8 +331,9 @@ jobs: - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: "${{ matrix.python }}" cache: 'pip' + allow-prereleases: true - name: Install pandoc run: | sudo apt-get update @@ -333,29 +376,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 +408,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 +438,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: | 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