Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python as first item in "tool.poetry.dependencies" #42

Closed
KyleKing opened this issue Jan 27, 2023 · 1 comment · Fixed by #53
Closed

Python as first item in "tool.poetry.dependencies" #42

KyleKing opened this issue Jan 27, 2023 · 1 comment · Fixed by #53
Labels
enhancement New feature or request

Comments

@KyleKing
Copy link

I would like to use the --all option, but it reorders "python", which is first by convention for poetry packages.

> poetry new tmp
> cd tmp
> poetry add antigravity
> cat pyproject.toml
[tool.poetry]
name = "tmp"
version = "0.1.0"
description = ""
authors = ["Kyle King <KyleKing@users.noreply.github.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
antigravity = "^0.1"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
> toml-sort pyproject.toml -i -a
> cat pyproject.toml
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]

[tool.poetry]
authors = ["Kyle King <KyleKing@users.noreply.github.com>"]
description = ""
name = "tmp"
readme = "README.md"
version = "0.1.0"

[tool.poetry.dependencies]
antigravity = "^0.1"
python = "^3.11"

Where, if sorted manually or by poetry-plugin-sort, I would expect the dependencies to be sorted as:

[tool.poetry.dependencies]
python = "^3.11"
antigravity = "^0.1"

Would you be interested in a feature that would recognize tool.poetry.dependencies in pyproject.toml and keep the python dependency first? If so, I would be happy to try to contribute and if so, would probably add some sort of generic hook to override the sort order for edge cases like these

@KyleKing KyleKing changed the title Python as first Dependency Python as first item in "tool.poetry.dependencies" Jan 27, 2023
@pappasam
Copy link
Owner

@KyleKing yes, this feature would be great! I think it relates somewhat this this issue as well: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants