From 981b1ac67de2d35800af03b3a730090157873dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20W=C3=B3jtowicz?= Date: Sun, 22 Nov 2026 20:31:16 +0100 Subject: [PATCH] ci: test the lowest dependency versions and a model from the wheel --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++-- CHANGELOG.md | 1 + CONTRIBUTING.md | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06d9a4b..308dd34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,25 @@ jobs: - run: uv sync --locked - run: uv run pytest + lowest: + name: Test (lowest dependency versions) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + with: + python-version: "3.12" + # The lowest versions that pyproject.toml allows, so that its lower bounds stay true. + # Without the project, uv leaves uv.lock alone. pytest and pytest-cov get the bounds of + # the dev group, or they would be their oldest releases. + - run: >- + uv run --no-project --isolated --resolution lowest-direct + --with-editable ".[sklearn]" --with "pytest>=9.2" --with "pytest-cov>=7.1" + pytest + build: name: Build runs-on: ubuntu-latest @@ -56,13 +75,24 @@ jobs: - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 - run: uv build # Install the wheel the way a user gets it from PyPI: no lock file, newest dependencies. - - run: uv run --isolated --no-project --with dist/*.whl miniops version + # A project and a model made with it outside the repository check the packaged templates, + # and model.py, which imports the flavor, checks the model environment. + - name: Use the built package + run: | + miniops() { uv run --isolated --no-project --with "$GITHUB_WORKSPACE"/dist/*.whl miniops "$@"; } + miniops version + mkdir "$RUNNER_TEMP/project" + cd "$RUNNER_TEMP/project" + miniops init + miniops new churn --flavor sklearn --task binary_classification + cat models/churn/.python-version + models/churn/.venv/bin/python models/churn/model.py all-checks: name: All checks # The branch ruleset requires only this job, so it stays valid when the test matrix changes. if: always() - needs: [lint, test, build] + needs: [lint, test, lowest, build] runs-on: ubuntu-latest timeout-minutes: 5 steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa9947..4fce47b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - On Windows, output redirected to a file or a pipe shows a character that its code page lacks as `?`, instead of stopping the command. - An unexpected error inside a project shows a short message with the path of the log instead of a traceback. Outside a project, where there is no log, the traceback is still shown. - pydantic is now a dependency. It validates the configuration files. +- Continuous integration also runs the tests with the lowest dependency versions that `pyproject.toml` allows, and creates a project and a model with the built package. ## [0.1.0a1] - 2026-11-11 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d572407..aae4e78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,7 @@ Write comments the way you would explain something to a colleague: in plain, nat - Add or update tests and documentation together with the code, and add an entry to `CHANGELOG.md` under "Unreleased". - Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages and PR titles, for example `feat(registry): add version bump command` or `fix(cli): handle missing config file`. - Pull requests are squash-merged, so the PR title becomes the commit message on `main`. -- CI runs the pre-commit checks, the tests on Linux, macOS and Windows with every supported Python version, and a package build. All of it has to pass before a pull request is merged. +- CI runs the pre-commit checks, the tests on Linux, macOS and Windows with every supported Python version, the tests once more with the lowest dependency versions that `pyproject.toml` allows, and a package build that creates a project and a model with the built wheel. All of it has to pass before a pull request is merged. ## Reporting security issues