MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_cpython_version

Function _get_cpython_version

scripts/update_lib/deps.py:222–235  ·  view source on GitHub ↗

Get CPython version from git tag for cache namespace.

(cpython_prefix: str)

Source from the content-addressed store, hash-verified

220
221
222def _get_cpython_version(cpython_prefix: str) -> str:
223 """Get CPython version from git tag for cache namespace."""
224 try:
225 result = subprocess.run(
226 ["git", "describe", "--tags", "--abbrev=0"],
227 cwd=cpython_prefix,
228 capture_output=True,
229 text=True,
230 )
231 if result.returncode == 0:
232 return result.stdout.strip()
233 except Exception:
234 pass
235 return "unknown"
236
237
238def _get_cache_path() -> str:

Callers 2

_build_test_import_graphFunction · 0.85
_build_lib_import_graphFunction · 0.85

Calls 2

runMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected