Mercurial > public > mercurial-scm > hg-stable
changeset 52571:82c8fb6a048c
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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 17 Dec 2024 22:32:12 -0500 |
parents | 7091b39adc65 |
children | 384d71e3dd65 |
files | pyproject.toml |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff