pyproject: lock in the major version of `black` that's required
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 17 Dec 2024 22:32:12 -0500
changeset 52545 82c8fb6a048c
parent 52544 7091b39adc65
child 52546 384d71e3dd65
pyproject: lock in the major version of `black` that's required The `hghave` checks already look for an exact this minor version of this, but according to their Stability Policy[1], we can use any version with the same major number. The reason for adding this here is we don't want someone to blindly run the tool and get a different format because they were running a different major version locally. It also makes it easier to discover when the required version has changed, because that's included in the error message. If there's concern about duplication and forgetting to update one place or the other, we can pipe a trivial python statement to it, and see if it exits with a failure. FWIW, having it in the project file here is also enforced when running `test-check-format.t`. It's not enforced by the `hghave` version check, so if it gets out of sync, the test will run and print: Oh no! \xf0\x9f\x92\xa5 \xf0\x9f\x92\x94 \xf0\x9f\x92\xa5 The required version `24` does not match the running version `23.3.0`! [1] https://github.com/psf/black/blob/30759ca782429221cfb329f335e2074cb359decb/docs/the_black_code_style/index.md?plain=1#L24
pyproject.toml
--- a/pyproject.toml	Tue Dec 17 22:23:05 2024 -0500
+++ b/pyproject.toml	Tue Dec 17 22:32:12 2024 -0500
@@ -54,6 +54,7 @@
 | mercurial/locale/
 | mercurial/thirdparty/
 '''
+required-version = "23"
 skip-string-normalization = true
 quiet = true