Alphabetically sort your Poetry dependencies
Project description
poetry-sort
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
poetry-sort can be configured via a tool.sort.config
section in your pyproject.toml
file.
[tool.sort.config]
case-sensitive = false
sort-python = false
format = true
The following options are available:
-
case-sensitive
(bool
, default:false
): Whether to take case into account when sorting. -
sort-python
(bool
, default:false
): Whether to also sort thepython
dependency. Iffalse
, thepython
dependency will be placed at the top oftool.poetry.dependencies
; iftrue
, it will be sorted alphebetically with everything else. -
format
(bool
, default:true
): Whether to apply some basic formatting topyproject.toml
after sorting. Iftrue
, poetry-sort will take all occurences of three or more consecutive newlines inpyproject.toml
and replace them with two newlines. Iffalse
, poetry-sort will not modifypyproject.toml
beyond just sorting your dependencies.
License
poetry-sort is licensed udner the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file poetry_sort-1.1.0.tar.gz
.
File metadata
- Download URL: poetry_sort-1.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.11.1 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3c570cd7367788112cf5413127e101b224d2f9f3931320c437389f35155cbd4 |
|
MD5 | 5d5c19b33a2c952014c73a8d3526f6b1 |
|
BLAKE2b-256 | 869f97c96d58a9a56186b4263caa7b848b3ac9c9b92da8393430070bbefbb1c6 |
File details
Details for the file poetry_sort-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: poetry_sort-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.11.1 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1db2a8b66334114912c15c5815f29c5d53e231f56e920be50e151dda63fd2272 |
|
MD5 | aa5fdae2e76029b03ab19f84c5086659 |
|
BLAKE2b-256 | c4b6467254b75e356f35e34082da2ac6adad2686f572ea719aa0ea0aa154d408 |