Poetry Plugin Sort

raw JSON →
0.3.0 verified Fri May 01 auth: no python

A Poetry plugin that automatically sorts dependencies alphabetically in pyproject.toml. Version 0.3.0 requires Python >=3.8, <4.0. Released under MIT license. Active development, infrequent releases.

pip install poetry-plugin-sort
error ModuleNotFoundError: No module named 'poetry_plugin_sort'
cause The plugin is installed via pip but not registered as a Poetry plugin, or Poetry is not finding it.
fix
Reinstall using 'poetry self add poetry-plugin-sort' instead of 'pip install poetry-plugin-sort'.
error Command 'sort' not found. Did you mean one of these? ...
cause The plugin is not installed or not registered correctly.
fix
Ensure you've run 'poetry self add poetry-plugin-sort' and that your Poetry version is >=1.2.0.
error Cannot use 'poetry sort' because no pyproject.toml found
cause The command must be run from a directory containing a pyproject.toml file.
fix
Navigate to the root of your project (where pyproject.toml is located) and run 'poetry sort'.
gotcha After updating the plugin, you must run 'poetry self show plugins' to verify the plugin is active. If not listed, re-add with 'poetry self add poetry-plugin-sort'.
fix Re-run 'poetry self add poetry-plugin-sort' after upgrading Poetry or the plugin.
gotcha The 'poetry sort' command only sorts dependencies in the [tool.poetry.dependencies] and [tool.poetry.dev-dependencies] sections, not other groups like [tool.poetry.group.*.dependencies].
fix Manually sort other dependency groups or use a tool like 'toml-sort'.
gotcha If you installed the plugin via 'pip install' without using 'poetry self add', the plugin won't be recognized by Poetry. The correct installation method is 'poetry self add poetry-plugin-sort' (requires Poetry 1.2+).
fix Run 'poetry self add poetry-plugin-sort' to properly register the plugin.
poetry self add poetry-plugin-sort

Install the plugin globally for Poetry, then run 'poetry sort' to alphabetically sort the dependencies in pyproject.toml.

pip install poetry-plugin-sort
poetry self add poetry-plugin-sort
poetry sort