skillfed

uv-sort

Sort uv's dependencies alphabetically

uv-sort v0.7.1 220.0K downloads/30d#9,314 on PyPI23
Permissive license Active released

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-sort

uv

uv add uv-sort

poetry

poetry add uv-sort

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

sort uv dependenciesalphabetize pyproject.tomluv dependency organizerpyproject.toml formatterdependency sorting tool
dependency-managementuv-ecosystempre-commit-ready

More Build Tools packages