Validate that requested version matches pyproject.toml.
(requested_version: str)
| 208 | |
| 209 | |
| 210 | def _validate_version(requested_version: str) -> bool: |
| 211 | """Validate that requested version matches pyproject.toml.""" |
| 212 | current_version = _get_version_from_file(VERSION_FILE) |
| 213 | if current_version != requested_version: |
| 214 | _fail( |
| 215 | f"Version mismatch!\n" |
| 216 | f" Requested: {requested_version}\n" |
| 217 | f" In {VERSION_FILE}: {current_version}\n" |
| 218 | f"Please update {VERSION_FILE} to {requested_version} first." |
| 219 | ) |
| 220 | print(f"✓ Version validated: {requested_version}\n") |
| 221 | return True |
| 222 | |
| 223 | |
| 224 | def _check_git_working_tree() -> None: |
no test coverage detected