From 70c81abdd86b67d6a792d13595b88e8bc5d00f95 Mon Sep 17 00:00:00 2001 From: David Perl Date: Fri, 31 Jul 2026 15:48:53 +0200 Subject: [PATCH] ci: add better linting --- .gitea/workflows/ci.yml | 17 +++++++++++++++++ pyproject.toml | 17 +++++++++++------ tests/unit/utils/test_beamline_dispatch.py | 4 +--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 90e34916..91e9fbf1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -30,6 +30,23 @@ jobs: source .venv/bin/activate ruff format --check + - name: Lint + run: | + source .venv/bin/activate + ruff check + + - name: Checkout pyright diff plugin + uses: actions/checkout@v5 + with: + repository: mx/diff_quality_basedpyright + path: diff_quality_basedpyright + + - name: Typecheck Diff + run: | + source .venv/bin/activate + uv pip install -e diff_quality_basedpyright + diff-quality --violations=basedpyright + test: runs-on: ubuntu-latest needs: "lint" diff --git a/pyproject.toml b/pyproject.toml index 0a8e1aa3..dd66e399 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,13 +36,18 @@ dependencies = [ [project.optional-dependencies] test = [ -# "pytest==9.0.3", - "pytest-cov==7.1.0", - "pytest-mock==3.14.0", - "pytest-qt==4.4.0", - "pytest-asyncio==0.25.3", + "basedpyright", + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-qt", + "pytest-asyncio", "pytest-timeout", - "ruff==0.15.*" + "ruff>=0.15" +] + +docs = [ + "zensical" ] [lint] diff --git a/tests/unit/utils/test_beamline_dispatch.py b/tests/unit/utils/test_beamline_dispatch.py index fa53ef6f..ff29f700 100644 --- a/tests/unit/utils/test_beamline_dispatch.py +++ b/tests/unit/utils/test_beamline_dispatch.py @@ -1,12 +1,10 @@ -import importlib +import importlib.util from unittest.mock import patch import pytest from aare.beamline_dispatch.beamline_dispatch import get_beamline_dispatch from aare.beamline_dispatch.simulated import SimulatedDispatch -from aare.beamline_dispatch.x06da.beamline_dispatch import X06daDispatch -from aare.beamline_dispatch.x06sa import X06saDispatch from aare.beamline_dispatch.x10sa import X10saDispatch