Repository navigation
dev: format pyproject.toml with taplo - #4215
Open
oresttokovenko wants to merge 12 commits into
Open
oresttokovenko wants to merge 12 commits into
oresttokovenko wants to merge 12 commits into
Conversation
Collaborator
|
The CI failures will be fixed by #4216 |
The Makefile, the pre-commit config, and the CI workflows each described the same checks in their own way, and tool versions were pinned in two of them. One noxfile now holds the sessions, the justfile names them, and CI runs the same sessions a developer runs locally.
The sdist carries no .gitignore, and release verification loads the noxfile from an unpacked sdist, so the read must tolerate its absence.
The justfile is a convenience for local runs. CI has no reason to install a task runner to reach the sessions it already names.
`uv run` syncs the project environment on demand, and the test and coverage sessions build their own environments from uv.lock, so the explicit install only synced the extras a second time.
The wrapper named every member after the string it held, and only two of the six reached a call site, so it added a lookup without removing a literal.
Those files are not new: the Makefile ran coverage with --parallel-mode as well, and noxfile's clean session still removes them.
coverage already reads [tool.coverage.run] source from pyproject.toml, so the session stops repeating --source, and the 85 default moves next to it as [tool.coverage.report] fail_under. COVERAGE_FAIL_UNDER still overrides it, because the integration job accepts lower coverage than the unit suite.
mypy finds the config file on its own, so --config-file was redundant, and --scripts-are-modules is a setting rather than an invocation choice.
pyproject.toml configures every tool here, and a wrong type only surfaces when a tool fails to read it. taplo checks it against the SchemaStore schema, driven by .taplo.toml because taplo does not read its settings from pyproject.toml.
taplo has no support for [tool.taplo] yet (tamasfe/taplo#603), so a .taplo.toml existed only to hold one URL. --schema does the same job and leaves no extra file.
The file is edited often and had drifted between two and four space indentation. taplo's defaults are two spaces and one entry per line, so the session needs no configuration of its own.
The session is a gate, so it should say whether the file is formatted. Rewriting is left to whoever is editing, which is how the other checks in this repository behave under --check.
oresttokovenko
force-pushed
the
taplo-pyproject-schema
branch
from
October 31, 2026 22:31
3a833c6 to
cf46358
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a
pyprojectnox session that checkspyproject.tomlformatting with taplo, and reformat the file once with the tool's defaults: two-space indentation, and one entry per line in multi-line arraysWhy
Formatting
pyproject.tomlit keeps future diffs small and puts the file under the same gate as the codeTests
There is no change to the logic
this PR is Stacked on #4208