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]
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-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: poetry_sort-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 f0e82d65820b78002834fbcbe7d38685b4f1bb3cbd8f42033dc7a7584037bc96
MD5 f63fdaaf646e46303bbb7d3dde307986
BLAKE2b-256 57b4ed3aadd25139b2e20b35fd1ea78aed70bf0c1cb006141638f9dd7c454366

See more details on using hashes here.

File details

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

File metadata

  • Download URL: poetry_sort-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac9d77ca499dab8f47a66dee11d990108835500e4d9f635f5e4883cadc6eb4ff
MD5 17b13f9d28262bd2eff2cd62116cd9ed
BLAKE2b-256 1b3d4e9bf27255b399157abdb03460c43117bc62c78b5fec3e2cdac7ea390eeb

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