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
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 runningpoetry add
orpoetry 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 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.
License
poetry-sort is licensed under 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-2.0.0.tar.gz
.
File metadata
- Download URL: poetry_sort-2.0.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69f5b6387956c5fd462946d4e5e0fb1ab8dec4f14b6415dcc4eb7202a6333897 |
|
MD5 | 06634e4c614c72c80c7a7cfc17334e2a |
|
BLAKE2b-256 | 286817dffe21a7cc2b822b5e090e4dfbcc16cce60fe6ea5332f10c4e3aa9da65 |
File details
Details for the file poetry_sort-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: poetry_sort-2.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed02e5428008f9a11e7687d03bf5badb02aec59ac9ddaee347da81e891b125d |
|
MD5 | 0cab103d8fcb21436c2278c4cd4cbcbe |
|
BLAKE2b-256 | 3b5279179537d709b0f5e6431e8114f0d06770f7845a69f515e8fdcc44b4b0a6 |