Poetry plugin to sort the dependencies alphabetically
Project description
Poetry Plugin: Dependencies sorting
This package is a plugin that sort dependencies alphabetically in pyproject.toml
after running poetry init
, poetry add
, or poetry remove
.
Since Introduce dependency sorting #3996 pull request still open
this plugin is a workaround for !312 issue.
Note: the plugin is in the beta version!
Before:
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["<author@example.com>"]
[tool.poetry.dependencies]
# a comment about a python version
python = "^3.11"
pydantic = "==1.6.2" # upgrade pydantic to ...
# Some notes about uvicorn
uvicorn = "^0.19.0"
#starlette = "==0.20.4"
fastapi = "^0.85.1"
#[tool.black]
#target-version = ['py11']
After:
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["<author@example.com>"]
[tool.poetry.dependencies]
# a comment about a python version
python = "^3.11"
#starlette = "==0.20.4"
fastapi = "^0.85.1"
pydantic = "==1.6.2" # upgrade pydantic to ...
# Some notes about uvicorn
uvicorn = "^0.19.0"
#[tool.black]
#target-version = ['py11']
Installation
Just use poetry self add
command to add this plugin.
poetry self add poetry-plugin-sort
If you used pipx to install Poetry, add the plugin via pipx inject
command.
pipx inject poetry poetry-plugin-sort
And if you installed Poetry using pip, you can install the plugin the same way.
pip install poetry poetry-plugin-sort
Usage
The plugin sorts dependencies each time when you change dependencies via the poetry init
, poetry add
, or
poetry remove
commands.
To sort dependencies without making changes to the depenencies list, the plugin provides a sort
command.
poetry sort
Project details
Release history Release notifications | RSS feed
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
Hashes for poetry_plugin_sort-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64309750cb1a956788534930b55250378ad6ec52000d0abc4054d4c564e94a4c |
|
MD5 | 85a6d339c236333be8848cd95754ec54 |
|
BLAKE2b-256 | ff406323124ffd1bebe070d72b0106c9ba0306dcaf402e1c93be05f2f0444ba6 |