Skip to content

Project dependencies with names matching up to a dash are not alphabetically sortedΒ #29

@kieran-ryan

Description

@kieran-ryan

When the project dependencies are sorted, they are done so alphabetically with the full content of the list. This includes operators. As a result, when we have the same package name for two packages, but one is extended with a dash, they end up in reverse order as '-' is compared against and precedes '=' alphabetically.

To resolve this issue, the logic would need to be modified to specifically check package names only and not the operators they are using to check versions, etc.

Expected Result

[project]
dependencies = [
    "tomli==2.0.1",
    "tomli-w==1.0.0",
]

Actual Result

[project]
dependencies = [
    "tomli-w==1.0.0",
    "tomli==2.0.1",
]

Reproduction Steps

pyprojectsort

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo πŸ“š

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions