Skip to content

Commit 6eee69f

Browse files
committed
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 <hans-johnson@uiowa.edu>
1 parent aff7aad commit 6eee69f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
- id: mixed-line-ending
3131

3232
- repo: https://github.com/astral-sh/ruff-pre-commit
33-
rev: v0.16.5
33+
rev: v0.16.5 # ruff version, keep synced with the ruff pin in pyproject.toml's testing extra
3434
hooks:
3535
- id: ruff-check
3636
args: ["--fix"]
@@ -41,7 +41,7 @@ repos:
4141
)
4242
4343
- repo: https://github.com/psf/black-pre-commit-mirror
44-
rev: 26.5.1 # Black version, keep synced with MONAI requirements
44+
rev: 26.5.1 # Black version, keep synced with the black pin in pyproject.toml's testing extra
4545
hooks:
4646
- id: black
4747
language_version: python3
@@ -53,7 +53,7 @@ repos:
5353
)
5454
5555
- repo: https://github.com/pycqa/isort
56-
rev: 9.0.1 # isort version, keep synced with MONAI requirements
56+
rev: 9.0.1 # isort version, keep synced with the isort pin in pyproject.toml's testing extra
5757
hooks:
5858
- id: isort
5959
name: isort (python)

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ transformers = ["transformers>=5.5.0"] # 5.x needs the transchex BertLayer/Bert
160160
zarr = ["zarr"]
161161
# these dependencies are for testing/building only, they aren't needed for regular use so don't appear in "all"
162162
testing = [
163-
"black>=26.5.1",
163+
"black>=26.5.1", # keep in sync with the black rev in .pre-commit-config.yaml
164164
"coverage>=5.5",
165-
"isort>9.0.0",
165+
"isort>9.0.0", # keep in sync with the isort rev in .pre-commit-config.yaml
166166
"mccabe",
167167
"packaging",
168168
"parameterized",
@@ -171,7 +171,7 @@ testing = [
171171
"pycodestyle",
172172
"pyflakes",
173173
"pyrefly>=1.0.0",
174-
"ruff>=0.16.5",
174+
"ruff>=0.16.5", # keep in sync with the ruff rev in .pre-commit-config.yaml
175175
"tomli", # used in print_dependencies.py for Python<3.11
176176
"types-PyYAML",
177177
"types-setuptools"

0 commit comments

Comments
 (0)