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

uv add should preserve alphabetic package ordering #6203

Closed
konstin opened this issue Aug 19, 2024 · 0 comments · Fixed by #6388
Closed

uv add should preserve alphabetic package ordering #6203

konstin opened this issue Aug 19, 2024 · 0 comments · Fixed by #6388

Comments

@konstin
Copy link
Member

konstin commented Aug 19, 2024

Currently, uv add always adds new entries last. It should instead preserve a lexicographic order if one is used.

Example: Running uv add "pydantic >=2.7.1" on:

[project]
dependencies = [
    "CacheControl[filecache]>=0.14,<0.15",
    "mwparserfromhell >=0.6.4,<0.7",
    "pywikibot >=9.1.2,<10",
    "sentry-sdk >=2.0.1,<3",
    "yarl >=1.9,<2",
    "pydantic>=2.7.1",
]

Current output:

[project]
dependencies = [
    "CacheControl[filecache]>=0.14,<0.15",
    "mwparserfromhell >=0.6.4,<0.7",
    "pywikibot >=9.1.2,<10",
    "sentry-sdk >=2.0.1,<3",
    "yarl >=1.9,<2",
    "pydantic>=2.7.1",
]

Desired output:

[project]
dependencies = [
    "CacheControl[filecache]>=0.14,<0.15",
    "mwparserfromhell >=0.6.4,<0.7",
    "pydantic >=2.7.1",
    "pywikibot >=9.1.2,<10",
    "sentry-sdk >=2.0.1,<3",
    "yarl >=1.9,<2",
]
@konstin konstin added the preview Experimental behavior label Aug 19, 2024
@zanieb zanieb removed the preview Experimental behavior label Aug 20, 2024
konstin added a commit that referenced this issue Aug 29, 2024
## Summary
resolves #6203

## Test Plan
added a test fixing the bug described in the issue.

---------

Co-authored-by: konstin <konstin@mailbox.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants