From 181021f2258e5ce12cd03e44740ff1838d8cb504 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Wed, 29 Oct 2025 23:51:27 +0000 Subject: [PATCH 1/9] remove 3.7 and 3.8 from noxfile --- noxfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 9874f7d..64f8fb9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -35,8 +35,6 @@ DEFAULT_PYTHON_VERSION = "3.8" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.7", - "3.8", "3.9", "3.10", "3.11", From 457ad13c325e7b211f9fb685b4cdf1b33f65670a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Wed, 29 Oct 2025 23:55:24 +0000 Subject: [PATCH 2/9] enable unit tests via github action --- .github/workflows/unittest.yml | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..77484cb --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,61 @@ +on: + pull_request: + branches: + - main +name: unittest +jobs: + unit: + # 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 + # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + runs-on: ubuntu-22.04 + strategy: + matrix: + python: {{unit_test_python_versions}} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ '{{' }} matrix.python {{ '}}' }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ '{{' }} matrix.python {{ '}}' }} + run: | + nox -s unit-${{ '{{' }} matrix.python {{ '}}' }} + - name: Upload coverage results + uses: actions/upload-artifact@v4 + with: + name: coverage-artifact-${{ '{{' }} matrix.python {{ '}}' }} + path: .coverage-${{ '{{' }} matrix.python {{ '}}' }} + include-hidden-files: true + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "{{ default_python_version }}" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v4 + with: + path: .coverage-results/ + - name: Report coverage results + run: | + find .coverage-results -type f -name '*.zip' -exec unzip {} \; + coverage combine .coverage-results/**/.coverage* + coverage report --show-missing --fail-under={{ cov_level if cov_level != None else 100 }} From dc0d2f4dd218a2083e71116969a03c3e1a881236 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Wed, 29 Oct 2025 23:59:08 +0000 Subject: [PATCH 3/9] update template with python versions --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 77484cb..26e6fa8 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python: {{unit_test_python_versions}} + python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12", "3.13"] steps: - name: Checkout uses: actions/checkout@v4 From fab7c96684c7358c98d4bcde41466674b647e387 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:06:42 +0000 Subject: [PATCH 4/9] fix github action --- .github/workflows/unittest.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 26e6fa8..6a0429d 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -11,28 +11,28 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12", "3.13"] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: ${{ '{{' }} matrix.python {{ '}}' }} + python-version: ${{ matrix.python }} - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel python -m pip install nox - name: Run unit tests env: - COVERAGE_FILE: .coverage-${{ '{{' }} matrix.python {{ '}}' }} + COVERAGE_FILE: .coverage-${{ matrix.python }} run: | - nox -s unit-${{ '{{' }} matrix.python {{ '}}' }} + nox -s unit-${{ matrix.python }} - name: Upload coverage results uses: actions/upload-artifact@v4 with: - name: coverage-artifact-${{ '{{' }} matrix.python {{ '}}' }} - path: .coverage-${{ '{{' }} matrix.python {{ '}}' }} + name: coverage-artifact-${{ matrix.python }} + path: .coverage-${{ matrix.python }} include-hidden-files: true cover: @@ -45,7 +45,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "{{ default_python_version }}" + python-version: "3.8" - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel @@ -58,4 +58,4 @@ jobs: run: | find .coverage-results -type f -name '*.zip' -exec unzip {} \; coverage combine .coverage-results/**/.coverage* - coverage report --show-missing --fail-under={{ cov_level if cov_level != None else 100 }} + coverage report --show-missing --fail-under=99 From 6e28218ed69406b9e8a861116621527ba1a58bd4 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:08:19 +0000 Subject: [PATCH 5/9] update default version in noxfile --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 64f8fb9..5ecf2b4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -32,7 +32,7 @@ ISORT_VERSION = "isort==5.11.0" LINT_PATHS = ["docs", "google_auth_httplib2.py", "tests", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.8" +DEFAULT_PYTHON_VERSION = "3.9" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ "3.9", From 90f550414b64ce8e80ac432220b7cacac6ec468d Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:10:24 +0000 Subject: [PATCH 6/9] update noxfile --- noxfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 5ecf2b4..2f38ad1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -72,7 +72,12 @@ CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() nox.options.sessions = [ - "unit", + "unit-3.9", + "unit-3.10", + "unit-3.11", + "unit-3.12", + "unit-3.13", + "unit-3.14", "system", "cover", "lint", From 06a3e45d7593b01a41618a5d48807ddb05e22282 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:13:05 +0000 Subject: [PATCH 7/9] add versions back --- noxfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/noxfile.py b/noxfile.py index 2f38ad1..acb621e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -35,6 +35,8 @@ DEFAULT_PYTHON_VERSION = "3.9" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ + "3.7", + "3.8", "3.9", "3.10", "3.11", From 6c2c732bfbc4581fffc1953b752120a8dd5d884c Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:22:10 +0000 Subject: [PATCH 8/9] remove 3.14 --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index acb621e..171e007 100644 --- a/noxfile.py +++ b/noxfile.py @@ -79,7 +79,6 @@ "unit-3.11", "unit-3.12", "unit-3.13", - "unit-3.14", "system", "cover", "lint", From 7deb6b8bdd31874dd2c364df90b5c4aa3a73642c Mon Sep 17 00:00:00 2001 From: ohmayr Date: Thu, 30 Oct 2025 00:46:39 +0000 Subject: [PATCH 9/9] update system test version --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 171e007..6a89536 100644 --- a/noxfile.py +++ b/noxfile.py @@ -59,7 +59,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.9"] SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [ "mock", "pytest",