-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Related issues
Relates to #6203.
Setup
- uv 0.5.11 (Homebrew 2024-12-20)
- Python 3.13
- macOS Sequoia 15.1.1
Observed behavior
When adding a series of dependencies with uv add:
uv add ruff
uv add pytest
uv add pytest-mock
uv add pytest-randomlythis is what I get in my pyproject.toml:
[project]
# ...
dependencies = [
"pytest-mock>=3.14.0",
"pytest>=8.3.4",
"ruff>=0.8.4",
"pytest-randomly>=3.16.0",
]The list of dependencies is updated as follows:
uv add ruff:ruffis added.uv add pytest:pytestis inserted beforeruff.uv add pytest-mock:pytest-mockis inserted beforepytest.uv add pytest-randomly:pytest-randomlyis appended as the last item.
So, sorting is broken at point 3.
Expected behavior
Since uv should sort the dependencies alphabetically (see #6388), I would rather expect:
[project]
# ...
dependencies = [
"pytest>=8.3.4",
"pytest-mock>=3.14.0",
"pytest-randomly>=3.16.0",
"ruff>=0.8.4",
]or, assuming that >= are taken into account in sorting:
[project]
# ...
dependencies = [
"pytest-mock>=3.14.0",
"pytest-randomly>=3.16.0",
"pytest>=8.3.4",
"ruff>=0.8.4",
]I believe that the first options seems to be more intuitive. In fact, by "sorting" dependencies I would rather think of sorting dependency names, not its specifiers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working