Get CPython version from git tag.
(cpython_dir: pathlib.Path)
| 185 | |
| 186 | |
| 187 | def get_cpython_version(cpython_dir: pathlib.Path) -> str: |
| 188 | """Get CPython version from git tag.""" |
| 189 | import subprocess |
| 190 | |
| 191 | result = subprocess.run( |
| 192 | ["git", "describe", "--tags"], |
| 193 | cwd=cpython_dir, |
| 194 | capture_output=True, |
| 195 | text=True, |
| 196 | check=True, |
| 197 | ) |
| 198 | return result.stdout.strip() |
| 199 | |
| 200 | |
| 201 | def git_commit( |
no test coverage detected