Skip to main content

poetry-sort

PyPI - Python Version PyPI GitHub release (latest SemVer) PyPI - License Code style: Black

poetry-sort is a Poetry plugin that alphabetically sorts the dependencies in your pyproject.toml file.

Installation

poetry self add poetry-sort

Usage

poetry sort

poetry sort supports the --with, --without, and --only options, which function identically to poetry install. For full usage information, run poetry sort --help.

poetry-sort runs automatically whenever you run poetry add or poetry init and will sort only the dependency groups that were modified by the command.

Configuration

You can configure poetry-sort via the tool.poetry.sort section of pyproject.toml.

[tool.sort.config]
auto = true
case-sensitive = false
sort-python = false
format = true

The following options are available:

  • auto (bool, default: true): Whether or not to automatically sort dependencies when running poetry add or poetry init. poetry sort can always be run manually, regardless of this setting.

  • case-sensitive (bool, default: false): Whether to take case into account when sorting.

  • sort-python (bool, default: false): Whether to also sort the python dependency. If false, the python dependency will be placed at the top of tool.poetry.dependencies; if true, it will be sorted alphebetically with everything else.

  • format (bool, default: true): Whether to apply some basic formatting to pyproject.toml after sorting. If true, poetry-sort will :take all occurences of three or more consecutive newlines in pyproject.toml and replace them with two newlines.

License

poetry-sort is licensed under the MIT License.

Metadata

Release files for poetry-sort 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poetry-sort 2.0.0
File Size Uploaded
poetry_sort-2.0.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poetry-sort 2.0.0
File Interpreter ABI Platform
poetry_sort-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / poetry_sort-2.0.0.tar.gz

Download URL poetry_sort-2.0.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
69f5b6387956c5fd462946d4e5e0fb1ab8dec4f14b6415dcc4eb7202a6333897
BLAKE2b-256 checksum
How to use checksums
286817dffe21a7cc2b822b5e090e4dfbcc16cce60fe6ea5332f10c4e3aa9da65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.15.0-1033-azure

Release files / poetry_sort-2.0.0-py3-none-any.whl

Download URL poetry_sort-2.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ed02e5428008f9a11e7687d03bf5badb02aec59ac9ddaee347da81e891b125d
BLAKE2b-256 checksum
How to use checksums
3b5279179537d709b0f5e6431e8114f0d06770f7845a69f515e8fdcc44b4b0a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.15.0-1033-azure

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page