Skip to main content

Poetry plugin to sort the dependencies alphabetically

Project description

Poetry Plugin: Dependencies sorting

PyPI Version Python Versions check

This package is a plugin that sort dependencies alphabetically in pyproject.toml after running poetry init and poetry add. Since Introduce dependency sorting #3996 pull request still open this plugin is a workaround for !312 issue.

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 and poetry add commands.

To sort dependencies without making changes to the dependencies list, the plugin provides a sort command.

poetry sort

Available options

  • --check: Checks if dependencies are sorted and exits with a non-zero status code when it doesn't.

Configurations

The following configuration can be set in [tool.poetry-sort] section of the pyproject.toml file or as system-wide environment variables:

  • enabled \ POETRY_SORT_ENABLED: Enable or disable sorting after invoking poetry init and poetry add commands. Default: True.
  • move-optionals-to-bottom \ POETRY_SORT_MOVE_OPTIONALS_TO_BOTTOM: Move optional packages to the bottom. Default: False.

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_plugin_sort-0.2.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

poetry_plugin_sort-0.2.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file poetry_plugin_sort-0.2.1.tar.gz.

File metadata

  • Download URL: poetry_plugin_sort-0.2.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure

File hashes

Hashes for poetry_plugin_sort-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5f2a3ac287a7fa6ae0983db48be670bc761ffeaa2a0bdac4789d0b044805b918
MD5 470c59d95d1fe3d7f0161ae807c7b181
BLAKE2b-256 3ae1c44bbd1132e2dd5e386512dcdbd61a79abde9b609254f95db64f4b801758

See more details on using hashes here.

File details

Details for the file poetry_plugin_sort-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_plugin_sort-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b43b5d405983314874dc87cc22f2edae83acfdd75dee05a78d72c54f04925eb
MD5 5f821de956bbdde1dec111a2cdcd8549
BLAKE2b-256 55b204a86929630baa86f01cb0146800f81f89797f48272eac09f353b99732c6

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