Skip to main content

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]
sort-python = false
format = true

The following options are available:

  • sort-python: 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. Defaults to false.

  • format: 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. Defaults to true.

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-0.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

poetry_sort-0.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file poetry_sort-0.0.0.tar.gz.

File metadata

  • Download URL: poetry_sort-0.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Darwin/21.6.0

File hashes

Hashes for poetry_sort-0.0.0.tar.gz
Algorithm Hash digest
SHA256 323e81f33ad819b777a62f72658c681d950b817e41517a375ee18e0046c3f0b0
MD5 84e4a2da991d8ee76760e8c47ec7d1bd
BLAKE2b-256 dbb0ece701ab0a4394c4db8d464c9aa343e96f13152bfce7bf88adf876b786ed

See more details on using hashes here.

File details

Details for the file poetry_sort-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: poetry_sort-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Darwin/21.6.0

File hashes

Hashes for poetry_sort-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2723c38ed94e503065b3f196f55b37e57e1dee1736fd62d47652bf271e3fe62c
MD5 425e277d71ddc9b16fbbd1934b1e2524
BLAKE2b-256 c8ae08fce90bbda3cba95ac5b7ea5638eae72c2c620566ba586da9e4678d6dec

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