From 4203cfd3e9b7027d38b78de625fadf55d80eb45e Mon Sep 17 00:00:00 2001 From: Jakob Stender Guldberg Date: Mon, 10 Aug 2026 15:32:55 +0200 Subject: [PATCH 1/3] ci: drive CI entirely through uv setup-uv provides the interpreter, so actions/setup-python is redundant; uv run syncs the environment on demand, so the separate uv sync step is too. Every job drops from 4-5 setup steps to 2. - drop actions/setup-python (setup-uv's python-version replaces it) - fold "Install dependencies" into the test step via uv run --extra - uv build instead of pip install build && python -m build - UV_LOCKED at workflow level: CI now fails if uv.lock is stale - enable-cache on setup-uv Behaviour is unchanged: the old jobs ran `uv sync --group test --no-dev` and then a bare `uv run`, which re-synced the default (dev) group anyway, so dev is what CI has always installed. The build job keeps --no-dev since it only ever installed runtime deps. --- .github/workflows/ci.yml | 172 +++++++++++---------------------------- 1 file changed, 46 insertions(+), 126 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50d6b86d..ef9d1a2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,11 @@ on: pull_request: branches: [main, master] +# Applies to every `uv` invocation below, so --locked need not be repeated +# in 15 jobs. Fails the run if uv.lock is out of date with pyproject.toml. +env: + UV_LOCKED: "1" + jobs: build: runs-on: ubuntu-latest @@ -16,23 +21,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - pip install -e . + enable-cache: true - name: Check package builds - run: python -m build + run: uv build - name: Verify CLI entry point - run: | - python -c "from sqlit.cli import main; print('CLI import OK')" + run: uv run --no-dev python -c "from sqlit.cli import main; print('CLI import OK')" nix-flake: runs-on: ubuntu-latest @@ -54,16 +52,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev + enable-cache: true - name: Run unit tests run: | @@ -90,16 +82,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev + enable-cache: true - name: Run SQLite integration tests run: uv run pytest tests/test_sqlite.py -v --timeout=60 @@ -127,16 +113,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra mssql + enable-cache: true - name: Wait for SQL Server to be ready run: | @@ -155,7 +135,7 @@ jobs: MSSQL_PORT: 1433 MSSQL_USER: sa MSSQL_PASSWORD: TestPassword123! - run: uv run pytest tests/test_mssql.py -v --timeout=120 + run: uv run --extra mssql pytest tests/test_mssql.py -v --timeout=120 test-postgresql: runs-on: ubuntu-latest @@ -180,16 +160,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra postgres + enable-cache: true - name: Run PostgreSQL integration tests env: @@ -198,7 +172,7 @@ jobs: POSTGRES_USER: testuser POSTGRES_PASSWORD: TestPassword123! POSTGRES_DATABASE: test_sqlit - run: uv run pytest tests/test_postgresql.py -v --timeout=120 + run: uv run --extra postgres pytest tests/test_postgresql.py -v --timeout=120 test-mysql: runs-on: ubuntu-latest @@ -224,16 +198,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra mysql + enable-cache: true - name: Run MySQL integration tests env: @@ -242,7 +210,7 @@ jobs: MYSQL_USER: root MYSQL_PASSWORD: TestPassword123! MYSQL_DATABASE: test_sqlit - run: uv run pytest tests/test_mysql.py -v --timeout=120 + run: uv run --extra mysql pytest tests/test_mysql.py -v --timeout=120 test-oracle: runs-on: ubuntu-latest @@ -267,16 +235,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra oracle + enable-cache: true - name: Run Oracle integration tests env: @@ -285,7 +247,7 @@ jobs: ORACLE_USER: testuser ORACLE_PASSWORD: TestPassword123! ORACLE_SERVICE: FREEPDB1 - run: uv run pytest tests/test_oracle.py -v --timeout=120 + run: uv run --extra oracle pytest tests/test_oracle.py -v --timeout=120 test-mariadb: runs-on: ubuntu-latest @@ -311,22 +273,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" + enable-cache: true - name: Install MariaDB Connector/C run: | sudo apt-get update sudo apt-get install -y libmariadb-dev - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra mariadb - - name: Run MariaDB integration tests env: MARIADB_HOST: 127.0.0.1 @@ -334,7 +290,7 @@ jobs: MARIADB_USER: root MARIADB_PASSWORD: TestPassword123! MARIADB_DATABASE: test_sqlit - run: uv run pytest tests/test_mariadb.py -v --timeout=120 + run: uv run --extra mariadb pytest tests/test_mariadb.py -v --timeout=120 test-duckdb: runs-on: ubuntu-latest @@ -345,19 +301,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra duckdb + enable-cache: true - name: Run DuckDB integration tests - run: uv run pytest tests/test_duckdb.py -v --timeout=60 + run: uv run --extra duckdb pytest tests/test_duckdb.py -v --timeout=60 test-cockroachdb: runs-on: ubuntu-latest @@ -366,16 +316,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra cockroachdb + enable-cache: true - name: Start CockroachDB run: | @@ -398,7 +342,7 @@ jobs: COCKROACHDB_USER: root COCKROACHDB_PASSWORD: "" COCKROACHDB_DATABASE: test_sqlit - run: uv run pytest tests/test_cockroachdb.py -v --timeout=120 + run: uv run --extra cockroachdb pytest tests/test_cockroachdb.py -v --timeout=120 test-firebird: runs-on: ubuntu-latest @@ -417,16 +361,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra firebird + enable-cache: true - name: Run Firebird integration tests env: @@ -435,7 +373,7 @@ jobs: FIREBIRD_USER: testuser FIREBIRD_PASSWORD: TestPassword123! FIREBIRD_DATABASE: /var/lib/firebird/data/test_sqlit.fdb - run: uv run pytest tests/test_firebird.py -v --timeout=120 + run: uv run --extra firebird pytest tests/test_firebird.py -v --timeout=120 test-clickhouse: runs-on: ubuntu-latest @@ -444,16 +382,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra clickhouse + enable-cache: true - name: Start ClickHouse run: | @@ -478,7 +410,7 @@ jobs: CLICKHOUSE_USER: default CLICKHOUSE_PASSWORD: testpass CLICKHOUSE_DATABASE: test_sqlit - run: uv run pytest tests/test_clickhouse.py -v --timeout=120 + run: uv run --extra clickhouse pytest tests/test_clickhouse.py -v --timeout=120 test-ssh: runs-on: ubuntu-latest @@ -487,16 +419,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra ssh --extra postgres + enable-cache: true - name: Create Docker network run: docker network create ssh-test-net @@ -553,7 +479,7 @@ jobs: POSTGRES_USER: testuser POSTGRES_PASSWORD: TestPassword123! POSTGRES_DATABASE: test_sqlit - run: uv run pytest tests/test_ssh.py -v --timeout=120 + run: uv run --extra ssh --extra postgres pytest tests/test_ssh.py -v --timeout=120 - name: Cleanup if: always() @@ -569,16 +495,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: uv sync --group test --no-dev --extra turso + enable-cache: true - name: Start Turso (libsql-server) run: | @@ -598,7 +518,7 @@ jobs: - name: Run Turso integration tests env: TURSO_URL: http://localhost:8080 - run: uv run pytest tests/test_turso.py -v --timeout=120 + run: uv run --extra turso pytest tests/test_turso.py -v --timeout=120 - name: Cleanup if: always() From b7749778e51392104c94d4f4e437b416c464970c Mon Sep 17 00:00:00 2001 From: Jakob Stender Guldberg Date: Mon, 10 Aug 2026 15:32:55 +0200 Subject: [PATCH 2/3] ci(release): build the package with uv build Drops actions/setup-python and the pip install build bootstrap. Same backend, same PEP 625 artifact names, so the AUR job's dist/sqlit_tui-${VERSION}.tar.gz lookup is unaffected. --- .github/workflows/release.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3cc1bfd5..b15c269a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,16 +51,12 @@ jobs: with: ref: ${{ env.RELEASE_TAG }} - - name: Set up Python - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v5 with: python-version: "3.12" - - name: Install build tools - run: python -m pip install --upgrade build - - name: Build package - run: python -m build + run: uv build - name: Upload dist artifacts uses: actions/upload-artifact@v4 From 27cdbb1bbaca2d38fd4b028898d5a1b98ad0ea97 Mon Sep 17 00:00:00 2001 From: Jakob Stender Guldberg Date: Mon, 10 Aug 2026 16:59:34 +0200 Subject: [PATCH 3/3] ci: cut redundant workflow config Four deletions, no behaviour change: - setup-uv v5 -> v7, which defaults enable-cache to "auto" (on for GitHub-hosted runners), so 15 explicit enable-cache lines go away. v7 is the newest moving major tag that actually exists; v8/v9 are published only as full version tags. - UV_PYTHON at workflow level, overridden per matrix job, replaces 15 copies of setup-uv's python-version input. uv provisions the interpreter either way. - Drop -v from every pytest call; pyproject already sets addopts = "-v". - Drop the trailing "docker stop/rm" Cleanup steps from test-ssh and test-turso. Runners are ephemeral, and the four other docker-run jobs never had them. --- .github/workflows/ci.yml | 125 +++++++++++++-------------------------- 1 file changed, 42 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef9d1a2f..adbb3c54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,11 @@ on: pull_request: branches: [main, master] -# Applies to every `uv` invocation below, so --locked need not be repeated -# in 15 jobs. Fails the run if uv.lock is out of date with pyproject.toml. +# Read by every `uv` invocation below. UV_LOCKED fails the run if uv.lock is +# out of date with pyproject.toml; UV_PYTHON is overridden by the matrix jobs. env: UV_LOCKED: "1" + UV_PYTHON: "3.12" jobs: build: @@ -18,13 +19,13 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] + env: + UV_PYTHON: ${{ matrix.python-version }} + steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Check package builds run: uv build @@ -49,17 +50,17 @@ jobs: matrix: python-version: ["3.10", "3.12"] + env: + UV_PYTHON: ${{ matrix.python-version }} + steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run unit tests run: | - uv run pytest tests/ -v --timeout=60 \ + uv run pytest tests/ --timeout=60 \ --ignore=tests/test_sqlite.py \ --ignore=tests/test_mssql.py \ --ignore=tests/test_postgresql.py \ @@ -79,16 +80,16 @@ jobs: matrix: python-version: ["3.10", "3.12"] + env: + UV_PYTHON: ${{ matrix.python-version }} + steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run SQLite integration tests - run: uv run pytest tests/test_sqlite.py -v --timeout=60 + run: uv run pytest tests/test_sqlite.py --timeout=60 test-mssql: runs-on: ubuntu-latest @@ -113,10 +114,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Wait for SQL Server to be ready run: | @@ -135,7 +133,7 @@ jobs: MSSQL_PORT: 1433 MSSQL_USER: sa MSSQL_PASSWORD: TestPassword123! - run: uv run --extra mssql pytest tests/test_mssql.py -v --timeout=120 + run: uv run --extra mssql pytest tests/test_mssql.py --timeout=120 test-postgresql: runs-on: ubuntu-latest @@ -160,10 +158,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run PostgreSQL integration tests env: @@ -172,7 +167,7 @@ jobs: POSTGRES_USER: testuser POSTGRES_PASSWORD: TestPassword123! POSTGRES_DATABASE: test_sqlit - run: uv run --extra postgres pytest tests/test_postgresql.py -v --timeout=120 + run: uv run --extra postgres pytest tests/test_postgresql.py --timeout=120 test-mysql: runs-on: ubuntu-latest @@ -198,10 +193,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run MySQL integration tests env: @@ -210,7 +202,7 @@ jobs: MYSQL_USER: root MYSQL_PASSWORD: TestPassword123! MYSQL_DATABASE: test_sqlit - run: uv run --extra mysql pytest tests/test_mysql.py -v --timeout=120 + run: uv run --extra mysql pytest tests/test_mysql.py --timeout=120 test-oracle: runs-on: ubuntu-latest @@ -235,10 +227,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run Oracle integration tests env: @@ -247,7 +236,7 @@ jobs: ORACLE_USER: testuser ORACLE_PASSWORD: TestPassword123! ORACLE_SERVICE: FREEPDB1 - run: uv run --extra oracle pytest tests/test_oracle.py -v --timeout=120 + run: uv run --extra oracle pytest tests/test_oracle.py --timeout=120 test-mariadb: runs-on: ubuntu-latest @@ -273,10 +262,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Install MariaDB Connector/C run: | @@ -290,7 +276,7 @@ jobs: MARIADB_USER: root MARIADB_PASSWORD: TestPassword123! MARIADB_DATABASE: test_sqlit - run: uv run --extra mariadb pytest tests/test_mariadb.py -v --timeout=120 + run: uv run --extra mariadb pytest tests/test_mariadb.py --timeout=120 test-duckdb: runs-on: ubuntu-latest @@ -298,16 +284,16 @@ jobs: matrix: python-version: ["3.10", "3.12"] + env: + UV_PYTHON: ${{ matrix.python-version }} + steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run DuckDB integration tests - run: uv run --extra duckdb pytest tests/test_duckdb.py -v --timeout=60 + run: uv run --extra duckdb pytest tests/test_duckdb.py --timeout=60 test-cockroachdb: runs-on: ubuntu-latest @@ -316,10 +302,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Start CockroachDB run: | @@ -342,7 +325,7 @@ jobs: COCKROACHDB_USER: root COCKROACHDB_PASSWORD: "" COCKROACHDB_DATABASE: test_sqlit - run: uv run --extra cockroachdb pytest tests/test_cockroachdb.py -v --timeout=120 + run: uv run --extra cockroachdb pytest tests/test_cockroachdb.py --timeout=120 test-firebird: runs-on: ubuntu-latest @@ -361,10 +344,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Run Firebird integration tests env: @@ -373,7 +353,7 @@ jobs: FIREBIRD_USER: testuser FIREBIRD_PASSWORD: TestPassword123! FIREBIRD_DATABASE: /var/lib/firebird/data/test_sqlit.fdb - run: uv run --extra firebird pytest tests/test_firebird.py -v --timeout=120 + run: uv run --extra firebird pytest tests/test_firebird.py --timeout=120 test-clickhouse: runs-on: ubuntu-latest @@ -382,10 +362,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Start ClickHouse run: | @@ -410,7 +387,7 @@ jobs: CLICKHOUSE_USER: default CLICKHOUSE_PASSWORD: testpass CLICKHOUSE_DATABASE: test_sqlit - run: uv run --extra clickhouse pytest tests/test_clickhouse.py -v --timeout=120 + run: uv run --extra clickhouse pytest tests/test_clickhouse.py --timeout=120 test-ssh: runs-on: ubuntu-latest @@ -419,10 +396,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Create Docker network run: docker network create ssh-test-net @@ -479,14 +453,7 @@ jobs: POSTGRES_USER: testuser POSTGRES_PASSWORD: TestPassword123! POSTGRES_DATABASE: test_sqlit - run: uv run --extra ssh --extra postgres pytest tests/test_ssh.py -v --timeout=120 - - - name: Cleanup - if: always() - run: | - docker stop sshserver postgres || true - docker rm sshserver postgres || true - docker network rm ssh-test-net || true + run: uv run --extra ssh --extra postgres pytest tests/test_ssh.py --timeout=120 test-turso: runs-on: ubuntu-latest @@ -495,10 +462,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - with: - python-version: "3.12" - enable-cache: true + - uses: astral-sh/setup-uv@v7 - name: Start Turso (libsql-server) run: | @@ -518,10 +482,5 @@ jobs: - name: Run Turso integration tests env: TURSO_URL: http://localhost:8080 - run: uv run --extra turso pytest tests/test_turso.py -v --timeout=120 + run: uv run --extra turso pytest tests/test_turso.py --timeout=120 - - name: Cleanup - if: always() - run: | - docker stop turso || true - docker rm turso || true