# Poetry Plugin: Dependencies sorting
[![PyPI Version](https://img.shields.io/pypi/v/poetry-plugin-sort?label=PyPI)](https://pypi.org/project/poetry-plugin-sort/)
[![Python Versions](https://img.shields.io/pypi/pyversions/poetry-plugin-sort)](https://pypi.org/project/poetry-plugin-sort/)
[![check](https://github.com/andrei-shabanski/poetry-plugin-sort/actions/workflows/test.yml/badge.svg)](https://github.com/andrei-shabanski/poetry-plugin-sort/actions/workflows/test.yml)
This package is a plugin that sort dependencies alphabetically in pyproject.toml
after running `poetry init` and `poetry add`.
Since [Introduce dependency sorting #3996](https://github.com/python-poetry/poetry/pull/3996) pull request still open
this plugin is a workaround for [!312](https://github.com/python-poetry/poetry/issues/312) issue.
## Installation
Just use `poetry self add` command to add this plugin.
```bash
poetry self add poetry-plugin-sort
```
If you used pipx to install Poetry, add the plugin via `pipx inject` command.
```bash
pipx inject poetry poetry-plugin-sort
```
And if you installed Poetry using pip, you can install the plugin the same way.
```bash
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.
```bash
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`.
Raw data
{
"_id": null,
"home_page": "https://github.com/andrei-shabanski/poetry-plugin-sort",
"name": "poetry-plugin-sort",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "poetry, plugin, dependencies sorting",
"author": "Andrei Shabanski",
"author_email": "shabanski.andrei@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9d/76/0ee2f93581280e9189ba4c45c4d7dbb4f6615cfa367f63b7f0ac433dad90/poetry_plugin_sort-0.2.2.tar.gz",
"platform": null,
"description": "# Poetry Plugin: Dependencies sorting\n\n[![PyPI Version](https://img.shields.io/pypi/v/poetry-plugin-sort?label=PyPI)](https://pypi.org/project/poetry-plugin-sort/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/poetry-plugin-sort)](https://pypi.org/project/poetry-plugin-sort/)\n[![check](https://github.com/andrei-shabanski/poetry-plugin-sort/actions/workflows/test.yml/badge.svg)](https://github.com/andrei-shabanski/poetry-plugin-sort/actions/workflows/test.yml)\n\nThis package is a plugin that sort dependencies alphabetically in pyproject.toml\nafter running `poetry init` and `poetry add`.\nSince [Introduce dependency sorting #3996](https://github.com/python-poetry/poetry/pull/3996) pull request still open\nthis plugin is a workaround for [!312](https://github.com/python-poetry/poetry/issues/312) issue.\n\n## Installation\n\nJust use `poetry self add` command to add this plugin.\n\n```bash\npoetry self add poetry-plugin-sort\n```\n\nIf you used pipx to install Poetry, add the plugin via `pipx inject` command.\n\n```bash\npipx inject poetry poetry-plugin-sort\n```\n\nAnd if you installed Poetry using pip, you can install the plugin the same way.\n\n```bash\npip install poetry poetry-plugin-sort\n```\n\n## Usage\n\nThe plugin sorts dependencies each time when you change dependencies via the `poetry init` and `poetry add` commands.\n\nTo sort dependencies without making changes to the dependencies list, the plugin provides a `sort` command.\n\n```bash\npoetry sort\n```\n\n### Available options\n\n* `--check`: Checks if dependencies are sorted and exits with a non-zero status code when it doesn't.\n\n### Configurations\n\nThe following configuration can be set in `[tool.poetry-sort]` section of the pyproject.toml file or as system-wide environment variables:\n\n* `enabled` \\ `POETRY_SORT_ENABLED`: Enable or disable sorting after invoking `poetry init` and `poetry add` commands. Default: `True`.\n* `move-optionals-to-bottom` \\ `POETRY_SORT_MOVE_OPTIONALS_TO_BOTTOM`: Move optional packages to the bottom. Default: `False`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Poetry plugin to sort the dependencies alphabetically",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/andrei-shabanski/poetry-plugin-sort",
"Repository": "https://github.com/andrei-shabanski/poetry-plugin-sort"
},
"split_keywords": [
"poetry",
" plugin",
" dependencies sorting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "649a88f44cfc9cfb26c8a7326c3b9844e683ed56b13b670cc1de84aef321bfff",
"md5": "a12e63f43ead4f007cddf6b08ca456d0",
"sha256": "8f87a7e23d8e0baa3402642a5ddfcd0d586ccf8d44ff1e8930e0c6ab33c2d919"
},
"downloads": -1,
"filename": "poetry_plugin_sort-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a12e63f43ead4f007cddf6b08ca456d0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 6887,
"upload_time": "2025-01-05T19:29:13",
"upload_time_iso_8601": "2025-01-05T19:29:13.418801Z",
"url": "https://files.pythonhosted.org/packages/64/9a/88f44cfc9cfb26c8a7326c3b9844e683ed56b13b670cc1de84aef321bfff/poetry_plugin_sort-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9d760ee2f93581280e9189ba4c45c4d7dbb4f6615cfa367f63b7f0ac433dad90",
"md5": "a8622d4afcdd503ee3925a5b0315fd2b",
"sha256": "38fa00d38f6183f054dbfd4b56db3e824067694b44b6b37f744ca0e03a5f9587"
},
"downloads": -1,
"filename": "poetry_plugin_sort-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "a8622d4afcdd503ee3925a5b0315fd2b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 5047,
"upload_time": "2025-01-05T19:29:15",
"upload_time_iso_8601": "2025-01-05T19:29:15.482418Z",
"url": "https://files.pythonhosted.org/packages/9d/76/0ee2f93581280e9189ba4c45c4d7dbb4f6615cfa367f63b7f0ac433dad90/poetry_plugin_sort-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-05 19:29:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "andrei-shabanski",
"github_project": "poetry-plugin-sort",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "poetry-plugin-sort"
}