Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 15 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,29 @@ on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test supported Python versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["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
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v5
id: cache
- name: Set up uv
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
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: Lint
# run: |
# pre-commit run --all-files
- name: Run tests
run: bash dev/test_python.sh
- name: Test installation
enable-cache: true
- 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: |
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__)'
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions dev/test_all.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
19 changes: 19 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""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.options.download_python = "auto"
nox.options.reuse_venv = "yes"


@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")
session.run("flit", "install", "--deps", "develop", "--symlink")
session.run("bash", "dev/test_python.sh", external=True)
Loading