Skip to content

Add required-version field to configuration#771

Merged
MatthewMckee4 merged 1 commit into
mainfrom
add-required-version
May 6, 2026
Merged

Add required-version field to configuration#771
MatthewMckee4 merged 1 commit into
mainfrom
add-required-version

Conversation

@MatthewMckee4
Copy link
Copy Markdown
Owner

Summary

Closes #579. Adds a top-level required-version field to karva.toml and the [tool.karva] table in pyproject.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.

required-version = ">=0.5.0"

The check runs at every config-loading entry point (karva.toml, --config-file / KARVA_CONFIG_FILE, and a discovered [tool.karva] table). Parsing uses semver::VersionReq, so an invalid specifier surfaces as a regular TOML parse error pointing at the offending value. Because required-version is 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

@MatthewMckee4 MatthewMckee4 added the configuration Related to configuring Karva label May 6, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 6, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 1 untouched benchmark


Comparing add-required-version (a5bc818) with main (eb3c800)

Open in CodSpeed

@MatthewMckee4 MatthewMckee4 merged commit 8d4f87c into main May 6, 2026
13 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-required-version branch May 6, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Related to configuring Karva

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Required version in configuration

1 participant