From f587776a865d6d9a2a547bb1438d131288e4044e Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 17:44:07 +0900 Subject: [PATCH 1/8] ci: reduce pull request Python matrix --- .github/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae61bcf..693ec63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,13 +5,19 @@ on: push: branches: - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ${{ fromJSON(github.event_name == 'pull_request' && '["3.12"]' || '["3.9","3.10","3.11","3.12"]') }} fail-fast: false defaults: @@ -32,9 +38,6 @@ jobs: - name: Install Flit if: steps.cache.outputs.cache-hit != 'true' run: bash dev/setup.sh -# - name: Lint -# run: | -# pre-commit run --all-files - name: Run tests run: bash dev/test_python.sh - name: Test installation From d9730aa9ce01b169c4f012de20ea85b155b1bec1 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 20:18:32 +0900 Subject: [PATCH 2/8] ci: define uv-backed multi-python test sessions --- noxfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 noxfile.py diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..329e89e --- /dev/null +++ b/noxfile.py @@ -0,0 +1,17 @@ +"""Nox sessions for supported Python versions.""" + +from __future__ import annotations + +import nox + +PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] + +nox.options.default_venv_backend = "uv" + + +@nox.session(python=PYTHON_VERSIONS) +def tests(session: nox.Session) -> None: + """Run the Flit-based test suite in an isolated uv-backed environment.""" + session.install("pip", "flit==3.9.0") + session.run("flit", "install", "--deps", "develop", "--symlink") + session.run("bash", "dev/test_python.sh", external=True) From 1beb81ef801ab9990fdc3bd82d7b03fbc3e1b48f Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 20:18:41 +0900 Subject: [PATCH 3/8] ci: run Python versions in parallel with Nox and uv --- .github/workflows/test.yml | 40 +++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 693ec63..5396058 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,33 +14,29 @@ concurrency: jobs: test: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + name: Test supported Python versions runs-on: ubuntu-latest - strategy: - matrix: - python-version: ${{ fromJSON(github.event_name == 'pull_request' && '["3.12"]' || '["3.9","3.10","3.11","3.12"]') }} - fail-fast: false - defaults: run: shell: bash - steps: - uses: actions/checkout@v5 - - name: Set up Python - uses: actions/setup-python@v6 + - name: Set up uv + uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7 with: - python-version: ${{ matrix.python-version }} - - uses: actions/cache@v5 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test - - name: Install Flit - if: steps.cache.outputs.cache-hit != 'true' - run: bash dev/setup.sh - - name: Run tests - run: bash dev/test_python.sh - - name: Test installation + enable-cache: true + - name: Install supported Python versions + run: uv python install 3.9 3.10 3.11 3.12 + - name: Run tests across Python versions in parallel + run: | + set -euo pipefail + nox_spec='nox[uv]==2026.7.11' + uvx --from "${nox_spec}" nox --list >/dev/null + printf '%s\0' 3.9 3.10 3.11 3.12 \ + | xargs -0 -P "$(nproc)" -I{} \ + uvx --from "${nox_spec}" nox --session "tests-{}" + - name: Test installation on primary Python run: | - pip install -e . - python -c 'import lightdash_client; print(lightdash_client.__version__)' + uv venv --python 3.12 + uv pip install -e . + uv run python -c 'import lightdash_client; print(lightdash_client.__version__)' From 2475b4c05919c857ee46300bf35fc83d3dc402cb Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 21:37:44 +0900 Subject: [PATCH 4/8] ci: expose Flit compatibility suite through nox tags --- noxfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 329e89e..9022795 100644 --- a/noxfile.py +++ b/noxfile.py @@ -7,9 +7,11 @@ PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"] nox.options.default_venv_backend = "uv" +nox.options.download_python = "auto" +nox.options.reuse_venv = "yes" -@nox.session(python=PYTHON_VERSIONS) +@nox.session(python=PYTHON_VERSIONS, tags=["ci"]) def tests(session: nox.Session) -> None: """Run the Flit-based test suite in an isolated uv-backed environment.""" session.install("pip", "flit==3.9.0") From 075798b432a6907fd074de9d3b5514b488fddef9 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 21:37:51 +0900 Subject: [PATCH 5/8] ci: add local nox compatibility entrypoint --- dev/test_all.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 dev/test_all.sh diff --git a/dev/test_all.sh b/dev/test_all.sh new file mode 100644 index 0000000..6e42f98 --- /dev/null +++ b/dev/test_all.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(dirname "${SCRIPT_DIR}")" +cd "${REPO_ROOT}" + +exec nox --tags ci "$@" From 8e73d9e1223e7ccc5ad802e2bcd9e76099138421 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 21:38:04 +0900 Subject: [PATCH 6/8] ci: add portable nox compatibility target --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c47033d..c29b89c 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,13 @@ lint: test: bash ./dev/test_python.sh +# Run the complete supported-Python suite through the same entrypoint as CI. +.PHONY: test-all +test-all: + uv run --with "nox[uv]==2026.7.11" bash ./dev/test_all.sh + # Build the package -build: clean lint test +build: clean lint test-all flit build clean: From df3a1315914a25e94478d0bfbe9986268b36beda Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sat, 15 Aug 2026 21:40:46 +0900 Subject: [PATCH 7/8] ci: run compatibility suite through repository entrypoint --- .github/workflows/test.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5396058..144a62e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,16 +25,8 @@ jobs: uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7 with: enable-cache: true - - name: Install supported Python versions - run: uv python install 3.9 3.10 3.11 3.12 - - name: Run tests across Python versions in parallel - run: | - set -euo pipefail - nox_spec='nox[uv]==2026.7.11' - uvx --from "${nox_spec}" nox --list >/dev/null - printf '%s\0' 3.9 3.10 3.11 3.12 \ - | xargs -0 -P "$(nproc)" -I{} \ - uvx --from "${nox_spec}" nox --session "tests-{}" + - name: Run compatibility tests + run: uv run --with "nox[uv]==2026.7.11" bash dev/test_all.sh - name: Test installation on primary Python run: | uv venv --python 3.12 From 45bdb844aa55c903bed44164e4e8737c978bee48 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Sun, 16 Aug 2026 07:17:09 +0900 Subject: [PATCH 8/8] ci: always run test job --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 144a62e..eac073a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,6 @@ concurrency: jobs: test: - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Test supported Python versions runs-on: ubuntu-latest defaults: