Add URL context to publish test script (#8289)

For #8288
This commit is contained in:
konsti 2024-10-17 16:31:23 +02:00 committed by GitHub
parent 83f835b0d0
commit a7bb3a767c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,7 +97,10 @@ def get_new_version(project_name: str) -> str:
# pick a version that doesn't exist on any target yet
versions = set()
for url in project_urls[project_name]:
data = httpx.get(url).text
try:
data = httpx.get(url).text
except httpx.HTTPError as err:
raise RuntimeError(f"Failed to fetch {url}") from err
href_text = "<a[^>]+>([^<>]+)</a>"
for filename in list(m.group(1) for m in re.finditer(href_text, data)):
if filename.endswith(".whl"):