From 080afe1bf7757208ba2c7995d1ca2754e3f78c2f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:46:02 +0200 Subject: [PATCH 1/2] Replace pre-commit with prek --- .github/workflows/lint.yml | 17 ++++++++--------- .github/zizmor.yml | 1 - tox.ini | 7 ++++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 77d1d1caa40..5f72550c09c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,18 +2,17 @@ name: Lint on: [push, pull_request, workflow_dispatch] +permissions: {} + env: FORCE_COLOR: 1 -permissions: - contents: read - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - build: + lint: runs-on: ubuntu-latest @@ -24,13 +23,13 @@ jobs: with: persist-credentials: false - - name: pre-commit cache + - name: prek cache uses: actions/cache@v4 with: - path: ~/.cache/pre-commit - key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }} + path: ~/.cache/prek + key: lint-prek-${{ hashFiles('**/.pre-commit-config.yaml') }} restore-keys: | - lint-pre-commit- + lint-prek- - name: Set up Python uses: actions/setup-python@v6 @@ -50,7 +49,7 @@ jobs: - name: Lint run: tox -e lint env: - PRE_COMMIT_COLOR: always + PREK_COLOR: always - name: Mypy run: tox -e mypy diff --git a/.github/zizmor.yml b/.github/zizmor.yml index e60c79441ca..f4949c30c43 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -1,4 +1,3 @@ -# Configuration for the zizmor static analysis tool, run via pre-commit in CI # https://docs.zizmor.sh/configuration/ rules: obfuscation: diff --git a/tox.ini b/tox.ini index 7f116c6e75f..de18946efa7 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ requires = tox>=4.2 env_list = lint + mypy py{py3, 315, 314, 313, 312, 311, 310} [testenv] @@ -18,11 +19,11 @@ commands = skip_install = true deps = check-manifest - pre-commit + prek pass_env = - PRE_COMMIT_COLOR + PREK_COLOR commands = - pre-commit run --all-files --show-diff-on-failure + prek run --all-files --show-diff-on-failure check-manifest [testenv:mypy] From 81e80f7a50e2e884d67d09ed7c735ee87f0f0f0a Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:35:41 +0200 Subject: [PATCH 2/2] Install and run tox/lint/mypy via uv --- .github/workflows/lint.yml | 51 +++++++++++--------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5f72550c09c..e2f8bf47ac4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,8 @@ permissions: {} env: FORCE_COLOR: 1 + PREK_COLOR: always + RUFF_OUTPUT_FORMAT: github concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -13,43 +15,18 @@ concurrency: jobs: lint: - runs-on: ubuntu-latest - name: Lint - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - - name: prek cache - uses: actions/cache@v4 - with: - path: ~/.cache/prek - key: lint-prek-${{ hashFiles('**/.pre-commit-config.yaml') }} - restore-keys: | - lint-prek- - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.x" - cache: pip - cache-dependency-path: "setup.py" - - - name: Build system information - run: python3 .github/workflows/system-info.py - - - name: Install dependencies - run: | - python3 -m pip install -U pip - python3 -m pip install -U tox - - - name: Lint - run: tox -e lint - env: - PREK_COLOR: always - - - name: Mypy - run: tox -e mypy + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: actions/setup-python@v6 + with: + python-version: "3.x" + - name: Install uv + uses: astral-sh/setup-uv@v7 + - name: Lint + run: uvx --with tox-uv tox -e lint + - name: Mypy + run: uvx --with tox-uv tox -e mypy