uv: Failure to download packages from Azure Artifacts starting version 0.7.0

Summary

Starting with UV 0.7.0 just today, I can no longer download packages from Azure Artifacts. Error:

uv sync
Resolved 382 packages in 0.74ms
  × Failed to download `my-private-pkg==4.0.0`
  ├─▶ Failed to extract archive: my_private_pkg-4.0.0-py3-none-any.whl
  ├─▶ an upstream reader returned an error: unexpected end of file
  ╰─▶ unexpected end of file

In the verbose logs I see the following which might be relevant:

TRACE Cached response https://pkgs.dev.azure.com/XXXXXX/_packaging/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/pypi/download/my-private-pkg/4/my_private_pkg-4.0.0-py3-none-any.whl is not storable because it does not meet any of the necessary criteria (e.g., it doesn't have an 'Expires' header set or a 'max-age' cache-control directive)
TRACE Considering retry of error: Extract("my_private_pkg-4.0.0-py3-none-any.whl", AsyncZip(UpstreamReadError(Kind(UnexpectedEof))))
TRACE Retrying error: `ConnectionReset` or `UnexpectedEof`
DEBUG Transient failure while handling response from https://pkgs.dev.azure.com/XXXXXX/_packaging/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/pypi/download/my-private-pkg/4/my_private_pkg-4.0.0-py3-none-any.whl; retrying...

These are the relevant portions of my pyproject.toml file:

dependencies = [
  "my-private-pkg>=4.0",
  ...
]

[tool.uv.sources]
my-private-pkg = { index = "azure" }
...

[[tool.uv.index]]
name = "azure"
url = "https://pkgs.dev.azure.com/XXXXXX/_packaging/XXXXXX/pypi/simple"

Platform

Ubuntu 24.04 amd64

Version

uv 0.7.0

Python version

Python 3.12.3

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 28 (16 by maintainers)

Commits related to this issue

Most upvoted comments

0.7.1 is now available with this fix.

I’m able to replicate this issue and verified that it occurs with 0.7.0 and not 0.6.17. Investigating now.

Fix in 0.7.1 works for me!

Version 0.6.17 worked fine. Version 0.7.0 failed before lunch, and 0.7.1 works after lunch! Super thanks for the fast fix @jtfmumm !

We’ll track rolling this change back out (with a fix for this case) in https://github.com/astral-sh/uv/issues/13255

+1, with self-hosted pypi + hatchling as build system it leads to:

> [7/7] RUN hatch env create dev:
0.394 Creating environment: dev
0.406 Installing project in development mode
0.555   × Failed to build `----- @ file:///app`
0.555   ├─▶ Failed to resolve requirements from `build-system.requires`
0.555   ├─▶ No solution found when resolving: `hatchling`
0.[555](https://github.com/-----/actions/runs/----/job/---#step:4:556)   ╰─▶ Because there are no versions of hatchling and you require hatchling, we
0.555       can conclude that your requirements are unsatisfiable.
------

For anyone googling by trace above: pip install uv==0.6.17 until fix will be released.

I’m pretty certain this is because of changes to redirect handling. I’m going to revert those changes to address this problem while investigating.