Extract version from pyproject.toml.
(file_path: str)
| 198 | |
| 199 | |
| 200 | def _get_version_from_file(file_path: str) -> str: |
| 201 | """Extract version from pyproject.toml.""" |
| 202 | with open(file_path, encoding="utf-8") as f: |
| 203 | content = f.read() |
| 204 | match = re.search(VERSION_PATTERN, content) |
| 205 | if match: |
| 206 | return match.group(1) |
| 207 | _fail(f"Could not find version in {file_path}") |
| 208 | |
| 209 | |
| 210 | def _validate_version(requested_version: str) -> bool: |
no test coverage detected