diff --git a/.gitignore b/.gitignore index e2fcd9b..63b828c 100644 --- a/.gitignore +++ b/.gitignore @@ -109,6 +109,9 @@ ipython_config.py # https://pdm.fming.dev/#use-with-ide .pdm.toml +# uv +uv.lock + # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ecc4517..0d42a14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,9 @@ repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.2 + - repo: local hooks: - id: ruff - + name: ruff + entry: uv run --extra dev ruff check --force-exclude + language: system + types_or: [python, pyi] + require_serial: true diff --git a/README.md b/README.md index 4710938..7ce79bb 100644 --- a/README.md +++ b/README.md @@ -215,11 +215,15 @@ To develop the package further: ```bash pip install -e ".[dev]" ``` -3. Install pre-commit hook +3. Install pre-commit hook. This requires [uv](https://docs.astral.sh/uv/), which the hook uses to run Ruff at the version pinned in `pyproject.toml`. ```bash pre-commit install ``` +### Linting + +Ruff is pinned in `pyproject.toml`, which is the single source of truth for the pre-commit hook, CI, and local `ruff check .` runs. Ruff version bumps and their repo-wide application should get their own PRs so lint compliance can stay focused and intentional. + ### Tests To run all tests: diff --git a/pyproject.toml b/pyproject.toml index 71f889b..8f35e8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,13 +25,6 @@ dependencies = [ "pathspec" ] -[project.optional-dependencies] -dev = [ - "pytest", - "ruff", - "pre-commit" -] - keywords = [ "checksum", "md5", @@ -44,6 +37,13 @@ keywords = [ "file-verification", ] +[project.optional-dependencies] +dev = [ + "pytest", + "ruff==0.16.0", + "pre-commit" +] + [project.urls] Homepage = "https://github.com/Imageomics/sum-buddy" Repository = "https://github.com/Imageomics/sum-buddy.git"