Add mypy type check for uv-python scripts (#5332)

## Summary

Per https://github.com/astral-sh/uv/pull/4853#issuecomment-2212505407

> If we're going to aim for full type coverage, we should probably
follow this by adding type checking in CI too otherwise it seems too
easy for it to become out of date.
This commit is contained in:
Jo 2024-07-23 22:14:05 +08:00 committed by GitHub
parent 025f2f3162
commit 43084249ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 17 deletions

View file

@ -14,12 +14,13 @@ Usage:
uv run --isolated -- crates/uv-python/template-download-metadata.py
"""
import sys
import logging
import argparse
import json
import logging
import subprocess
import sys
from pathlib import Path
from typing import Any
import chevron_blue
@ -66,10 +67,10 @@ def prepare_value(value: dict) -> dict:
return value
def main():
def main() -> None:
debug = logging.getLogger().getEffectiveLevel() <= logging.DEBUG
data = {}
data: dict[str, Any] = {}
data["generated_with"] = Path(__file__).relative_to(WORKSPACE_ROOT).as_posix()
data["generated_from"] = TEMPLATE.relative_to(WORKSPACE_ROOT).as_posix()
data["versions"] = [