uv-sort
Sort uv's dependencies alphabetically
What it is and what it does
uv-sort is a command-line tool that alphabetically sorts dependencies in uv project configuration files. It reads and rewrites pyproject.toml files to organize dependencies across multiple sections—dependency-groups, project.dependencies, project.optional-dependencies, tool.uv.dev-dependencies, and tool.uv.sources—into alphabetical order.
The tool runs as a standalone CLI and integrates with pre-commit and Lefthook workflows. It offers a --check flag to verify whether dependencies are already sorted, a --dry-run flag to preview changes without writing, and can be invoked directly or through uv's tools system (uvx) without installation. The package depends on tomlrt for TOML parsing and typer for CLI argument handling.
Use it for:
- Enforce consistent dependency ordering in CI/CD pipelines using the --check flag to fail builds when dependencies are unsorted.
- Integrate into pre-commit hooks to automatically sort dependencies before commits are accepted.
- Standardize dependency organization across multiple uv-based projects without manual editing.
- Preview dependency sorting changes with --dry-run before applying them to pyproject.toml.
- Run as a one-off tool via uvx without installing it locally to sort a single project's dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Alphabetically sorts dependencies in uv's pyproject.toml configuration files across dependency-groups, project.dependencies, optional-dependencies, dev-dependencies, and sources sections.
Yes. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Install it if you use uv and want to enforce alphabetical dependency ordering in your projects—or use uvx to run it on demand without installation.
Install
uv-sort on PyPI
pip
pip install uv-sortuv
uv add uv-sortpoetry
poetry add uv-sortInstalling uv-sort
Before you install
Low friction: pure Python wheel with only two runtime dependencies (tomlrt and typer). Actively maintained with a recent release; last commit on 2026-06-28.
License in practice
MIT license (permissive); no restrictions on use, modification, or distribution.
Quickstart
pip install uv-sort
# Sort dependencies in pyproject.toml in current directory
uv-sort
# Or specify a path
uv-sort /path/to/pyproject.toml
# Check without modifying
uv-sort --check
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — tomlrt, typer |
| Maintenance | actively maintained — 48 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 220,028/month — #9,314 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uv_sort-0.7.1-py3-none-any.whl
Keywords: uv
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
dependency-groupsParses and resolves PEP 735 dependency groups…
permissive · top 5,000 on PyPI
pyproject-fmtFormats pyproject.toml files with consistent,…
permissive · top 5,000 on PyPI
liccheckScans Python project dependencies in…
permissive · top 5,000 on PyPI
isortisort sorts Python imports alphabetically and…
permissive · top 1,000 on PyPI
sort-linesAlphabetizes lines in files based on…
permissive · top 15,000 on PyPI
pyproject2condaConverts Python project dependencies from…
unclear · top 15,000 on PyPI
creosoteCreosote scans your Python project's source…
permissive · top 5,000 on PyPI
uv-dynamic-versioningA Hatch plugin that automatically derives…
permissive · top 5,000 on PyPI
toml-sortCommand-line utility and Python library to sort…
permissive · top 15,000 on PyPI
nox-uvnox-uv replaces nox's standard session…
permissive · top 15,000 on PyPI