Add required-version field to configuration#771
Merged
Conversation
Merging this PR will not alter performance
|
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
Closes #579. Adds a top-level
required-versionfield tokarva.tomland the[tool.karva]table inpyproject.toml. The value is a SemVer requirement; if the installed karva does not satisfy it, karva exits with a clear error before any tests run, which avoids the confusing failures that show up when CI or a teammate is on an older version that does not understand newer config keys.The check runs at every config-loading entry point (
karva.toml,--config-file/KARVA_CONFIG_FILE, and a discovered[tool.karva]table). Parsing usessemver::VersionReq, so an invalid specifier surfaces as a regular TOML parse error pointing at the offending value. Becauserequired-versionis not part of any profile, it is special-cased in the doc generator so the configuration reference still gets the section even though the metadata-driven walker only sees per-profile options.Test Plan
ci