Skip to content

bug - uv sync fails or behaves unexpectedly when mutually incompatible depsets are present #18026

@fkiraly

Description

@fkiraly

Summary

The default behaviour of uv sync seem to result in an attempt to find lock versions that satisfy all dependency sets, see #16118

Having mutually conflicting dependency sets is a valid, even if not super common use case. This can occur, for instance, if different depsets are required for different operating systems, or for different backends (e.g., torch vs tensorflow in AI). Another use case are depsets that are specific to testing which can contain pins - two of these will typically be mutually incompatible.

I consider the default behaviour of uv sync a bug, when put against what nowadays seems to be the common user expectation - namely that a reasonable lockfile gets created. There also seems to be no workaround - adding explicit conflict clauses seems to result in long runtimes (1h or more), and unusable resolutions (ancient versions), on anecdotal evidence.

To reproduce, use uv sync on version 0.10.2, or any recent version, on any OS (windows, macos, linux), on the sktime repo https://github.com/sktime/sktime
To reproduce the failure of a reasonable workaround, run uv sync on the branch containing @yarnabrina's attempted fix in sktime/sktime#8892

The bug can be provoked also with any pyproject.toml and any other combination of mutually incompatible depsets.

Platform

any

Version

0.10.2

Python version

any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions