From 6eee69fb06c5149d7a99a91c3050f0057f994f8f Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Thu, 3 Sep 2026 10:02:06 -0500 Subject: [PATCH] DOC: Cross-reference ruff/black/isort version pins between the two files ruff, black and isort are each pinned twice: once in pyproject.toml's testing extra (the range a developer installs from) and once in .pre-commit-config.yaml (the exact rev pre-commit builds its environment from). Only black and isort carried a one-sided "keep synced" comment, in .pre-commit-config.yaml only; ruff had none anywhere. A contributor editing one pin had no in-file pointer to the other. Adds a same-line comment at each of the six pin sites naming the file holding its counterpart, so following either pin leads directly to the other. No version or behavior change. Signed-off-by: Hans Johnson --- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae03b5bae9..65c26c83f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.5 + rev: v0.16.5 # ruff version, keep synced with the ruff pin in pyproject.toml's testing extra hooks: - id: ruff-check args: ["--fix"] @@ -41,7 +41,7 @@ repos: ) - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.5.1 # Black version, keep synced with MONAI requirements + rev: 26.5.1 # Black version, keep synced with the black pin in pyproject.toml's testing extra hooks: - id: black language_version: python3 @@ -53,7 +53,7 @@ repos: ) - repo: https://github.com/pycqa/isort - rev: 9.0.1 # isort version, keep synced with MONAI requirements + rev: 9.0.1 # isort version, keep synced with the isort pin in pyproject.toml's testing extra hooks: - id: isort name: isort (python) diff --git a/pyproject.toml b/pyproject.toml index 684d905002..3cd3fa2c21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,9 +160,9 @@ transformers = ["transformers>=5.5.0"] # 5.x needs the transchex BertLayer/Bert zarr = ["zarr"] # these dependencies are for testing/building only, they aren't needed for regular use so don't appear in "all" testing = [ - "black>=26.5.1", + "black>=26.5.1", # keep in sync with the black rev in .pre-commit-config.yaml "coverage>=5.5", - "isort>9.0.0", + "isort>9.0.0", # keep in sync with the isort rev in .pre-commit-config.yaml "mccabe", "packaging", "parameterized", @@ -171,7 +171,7 @@ testing = [ "pycodestyle", "pyflakes", "pyrefly>=1.0.0", - "ruff>=0.16.5", + "ruff>=0.16.5", # keep in sync with the ruff rev in .pre-commit-config.yaml "tomli", # used in print_dependencies.py for Python<3.11 "types-PyYAML", "types-setuptools"