Sanitize version string for use as a directory name. Replaces any character not in [a-zA-Z0-9._-] with underscore. Matches the Rust SDK's sanitization logic.
(version: str)
| 42 | |
| 43 | |
| 44 | def _sanitize_version(version: str) -> str: |
| 45 | """Sanitize version string for use as a directory name. |
| 46 | |
| 47 | Replaces any character not in [a-zA-Z0-9._-] with underscore. |
| 48 | Matches the Rust SDK's sanitization logic. |
| 49 | """ |
| 50 | return re.sub(r"[^a-zA-Z0-9._\-]", "_", version) |
| 51 | |
| 52 | |
| 53 | def get_cache_dir(version: str | None = None) -> Path: |
no outgoing calls
no test coverage detected
searching dependent graphs…