mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Re-add 3 retries in uv publish
(#12041)
In the publish client, we have to set the client retries to 0 as the retry middleware is incompatible with upload bodies. This however also sets `client.retry_policy()` to a zero-retry policy, so we need to construct our own policy. Fixes #12027 --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
ba74b9ea93
commit
aa629c4a54
3 changed files with 20 additions and 10 deletions
|
@ -181,12 +181,18 @@ def get_latest_version(project_name: str, client: httpx.Client) -> Version:
|
|||
break
|
||||
except httpx.HTTPError as err:
|
||||
error = err
|
||||
print(f"Error getting version, sleeping for 1s: {err}", file=sys.stderr)
|
||||
print(
|
||||
f"Error getting version for {project_name}, sleeping for 1s: {err}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
time.sleep(1)
|
||||
except InvalidSdistFilename as err:
|
||||
# Sometimes there's a link that says "status page"
|
||||
error = err
|
||||
print(f"Invalid index page, sleeping for 1s: {err}", file=sys.stderr)
|
||||
print(
|
||||
f"Invalid index page for {project_name}, sleeping for 1s: {err}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
time.sleep(1)
|
||||
else:
|
||||
raise RuntimeError(f"Failed to fetch {url}") from error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue