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 either on a per-project basis in pyproject.toml
or globally in your Poetry
config.toml
file. Either way, configuration options are placed inside the tool.sort.config
key.
[tool.sort.config]
auto = true
case-sensitive = false
sort-python = false
format = true
Settings defined in pyroject.toml
will override settings defined in config.toml
.
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. 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.2.0.tar.gz
.
File metadata
- Download URL: poetry_sort-1.2.0.tar.gz
- Upload date:
- Size: 4.7 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 | e0a11c3de737c6002f210835c3cba49a37248cb4f9cb2810c156c46124e5ea25 |
|
MD5 | 0a0e508d3f5f5a317511d0c219b12d0a |
|
BLAKE2b-256 | 415474d125852ba7504f091f3ce3cbe36a91fdac38aa0ad5bb4d745d765834c0 |
File details
Details for the file poetry_sort-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: poetry_sort-1.2.0-py3-none-any.whl
- Upload date:
- Size: 5.1 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 | 71e4d634d92a7e92060743a3447096154089f1a56f23ccfdaf33166e1594bd2c |
|
MD5 | d6732ac9ef748b3732ab7b7929c895a8 |
|
BLAKE2b-256 | a09bc18aba15304ea6368d97795c991cc04f9971195c23c5958eea3b58347463 |