feat(config): support configuration via pyproject.toml - #761
Merged
Conversation
TheKevJames
force-pushed
the
kjames/pyproject-toml-config
branch
2 times, most recently
from
July 22, 2026 16:38
1ebd798 to
86d6629
Compare
Refactors coveralls/configuration.py into a package (ci, environment, files, helpers) with __init__ as the entrypoint. changelog: coveralls-python now reads configuration from a ``[tool.coveralls]`` table in ``pyproject.toml`` (no extra dependency required). The legacy ``.coveralls.yml`` is still supported and takes precedence when both exist.
TheKevJames
force-pushed
the
kjames/pyproject-toml-config
branch
from
July 22, 2026 16:43
86d6629 to
1d0071b
Compare
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.
Summary
Adds support for configuring coveralls-python via a
[tool.coveralls]table inpyproject.toml, alongside the existing sources (CI env,COVERALLS_*env vars,.coveralls.yml, CLI flags).TOML parsing is always available (stdlib
tomllibon 3.11+,tomlion 3.10 — now an explicit dependency), so unlike the legacy YAML support it needs no extra install.Behaviour
resolve()precedence stack: CI env →COVERALLS_*env → config file → CLI/kwarg overrides..coveralls.ymltakes precedence overpyproject.toml(matching the community norm used by coverage.py, mypy, pytest, and ruff, and preserving existing behaviour). A warning is emitted when both provide settings.[tool.coveralls]runs through the same alias/deprecation/unknown-key pipeline as.coveralls.yml.TOMLDecodeError; a non-tabletool.coverallsraisesTypeError; a missing table is silently ignored.Refactor
coveralls/configuration.pygrew past the 500-line limit, so it is split into a package with a strict one-directional import layering (repo → __init__ → {ci, environment, files} → helpers):helpers.py—Config, defaults, key canonicalization/filteringci.py— CI service detectionenvironment.py—COVERALLS_*env loadingfiles.py— YAML/TOML file readers + first-found-wins selection__init__.py—resolve()entrypoint, re-exportsConfigEach module owns its own logger (
coveralls.configuration.<module>).Docs
docs/usage/configuration.rstnow presentspyproject.tomlas the recommended approach and documents.coveralls.ymlas legacy (still fully supported).Tests
All 178 tests pass;
pre-commit run -ais clean. New TOML coverage lives intests/api/toml_config_test.py.