diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8148dc5..5220bb3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ on: jobs: tests: strategy: - fail-fast: false + fail-fast: true matrix: python-version: ["3.10", "3.11", "3.12"] os: [ubuntu-latest] @@ -30,7 +30,28 @@ jobs: - name: install run: | - pip install -e ".[test,dask]" + pip install -e ".[test,dask,dev]" + + # We run this for each Python version in the matrix which is redundant, + # but since ruff is fast, that's OK. We like to make sure that we install + # the ruff version from pyproject.toml, which we achieve by + # + # pip install -e ".[dev]" + # + # Doing this in another workflow such as lint.yml would install psweep + + # all deps again just for linting. + # + # The alternative would be to say + # + # pip install ruff== + # + # but then we duplicate version information, which has to be maintained. + - name: lint + run: | + # Check for lint rules. + ruff check . + # Check if files need to be formatted. Exit non-zero if the case. + ruff format --check . - name: run tests run: | diff --git a/pyproject.toml b/pyproject.toml index 2b45f1f..fe463d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,13 @@ test = [ "pytest-xdist", ] -dev = ["pre-commit"] +# We need to sync the ruff version here with the one in +# .pre-commit-config.yaml, ahh well. +dev = [ + "pre-commit", + "ruff == 0.2.1", +] + # See doc/requirements.txt #