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