Skip to main content

Alphabetically sort your Poetry dependencies

Project description

poetry-sort

PyPI - Python Version PyPI GitHub release (latest SemVer) PyPI - License

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 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. If false, poetry-sort will not modify pyproject.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

poetry_sort-1.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

poetry_sort-1.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for poetry_sort-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e3c570cd7367788112cf5413127e101b224d2f9f3931320c437389f35155cbd4
MD5 5d5c19b33a2c952014c73a8d3526f6b1
BLAKE2b-256 869f97c96d58a9a56186b4263caa7b848b3ac9c9b92da8393430070bbefbb1c6

See more details on using hashes here.

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

Hashes for poetry_sort-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1db2a8b66334114912c15c5815f29c5d53e231f56e920be50e151dda63fd2272
MD5 aa5fdae2e76029b03ab19f84c5086659
BLAKE2b-256 c4b6467254b75e356f35e34082da2ac6adad2686f572ea719aa0ea0aa154d408

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page