uv: Allow hiding "Missing version constraint" warning via configuration, or only warn for entire workspace

The configuration:

  • virtual workspace with A & B
  • package A that depends on “torch”
  • package B that depends on “torch==2.5.1”

doing a uv sync gives a warning about a missing version constraint for torch, I assume while it’s processing A’s dependencies. I’d like to hide these warnings, since they’re just noise for my developers. I also tried with --all-packages by turning my workspace root into a non-virtual workspace and adding a torch>1 dependency into the workspace root; but I still got the warning, so this seems like it’s a per-package warning, not an overall workspace warning.

Alternatively, this request could be to wait until the entire workspace constraints are collected and only then print the warnings.

(I’ve got a bunch of pre-pyproject external python projects in a monorepo; I’m creating the pyproject to mirror their requirements.txt files exactly, so I’d rather go in and fix the dependencies in their individual pyproject files)

Also – thank you for uv! It’s brought a lot of sanity to my developers 😃 Also also – I’m happy to make a PR for stuff like this; just let me know if it’s a PR you’d be OK with accepting

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

An application (like microservice), in contrast to a library, does not need to work with multiple versions of its dependencies. The typical workflow involves updating some or all dependencies (manually or using a tool like Renovate), testing the application with the updated versions, and deploying if everything works fine. If issues arise, the problematic dependency version is restricted (typically using !=, rarely with <), and the process is repeated. Since updates generally involve moving forward rather than downgrading versions, lower bounds have no impact on the outcome.

The best practice is to justify every version restriction on dependencies. For a library, this typically involves specifying the oldest version that provides the required features or, at the very least, the lowest version tested in a matrix. For an application, however, there is no need to support older versions of dependencies, and testing in a matrix is often too resource-intensive. Consequently, there is little reason to test with older versions. If lower bounds are set, they often become arbitrary numbers that cannot be justified or guaranteed to work with the application. Alternatively, if the lower bounds are updated along with the versions in the lock file, they end up duplicating the lock file’s role.

@MrMarvel thank you for the reproducer, fixed in https://github.com/astral-sh/uv/pull/11091.

comment

I updated to the latest uv version and the issue does not appear anymore when doing uv run … only doing uv sync for which its probably not a real issue

@samsja, I want to specificaly define property in my project (setting) so it hides warning for sync or lock (FEATURE)