perf(.github): set a timeout on get min versions HTTP calls (#35851)

During an automated code review of .github/scripts/get_min_versions.py,
the following issue was identified. Set a timeout on get min versions
HTTP calls. Network calls without a timeout can hang a worker
indefinitely. I kept the patch small and re-ran syntax checks after
applying it.
This commit is contained in:
Tejas Attarde
2026-03-13 17:24:32 -04:00
committed by GitHub
parent 9b22f9c450
commit d6dbcf6294
8 changed files with 19 additions and 15 deletions

View File

@@ -48,7 +48,7 @@ def get_pypi_versions(package_name: str) -> List[str]:
KeyError: If package not found or response format unexpected
"""
pypi_url = f"https://pypi.org/pypi/{package_name}/json"
response = requests.get(pypi_url)
response = requests.get(pypi_url, timeout=10.0)
response.raise_for_status()
return list(response.json()["releases"].keys())