Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify package priority order in pip compatibility guide #6619

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/pip/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,13 @@ consistent with

## Package priority

There are usually many possible solutions given a set of requirements — a resolver must choose
between the solutions. Unlike pip, uv's resolver uses the ordering provided of packages to determine
the default priority. This means that uv's resolution can differ based on the order of the packages.
For example, `uv pip install foo bar` would prioritize a newer version of `foo` over `bar`.
Similarly, this applies to the ordering of requirements in input files to `uv pip compile`.
There are usually many possible solutions given a set of requirements, and a resolver must choose
between them. uv's resolver and pip's resolver have a different set of package priorities. While
both resolvers use the user-provided order as one of their priorities, pip has additional
[priorities](https://pip.pypa.io/en/stable/topics/more-dependency-resolution/#the-resolver-algorithm)
that uv does not have. Hence, uv is more likely to be affected by a change in user order than pip
is.

For example, `uv pip install foo bar` prioritizes newer versions of `foo` over `bar` and could
result in a different resolution than `uv pip install bar foo`. Similarly, this behavior applies to
the ordering of requirements in input files for `uv pip compile`.
Loading