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

Fix pip-compile package ordering #1419

Merged
merged 4 commits into from Jun 16, 2021
Merged

Fix pip-compile package ordering #1419

merged 4 commits into from Jun 16, 2021

Conversation

adamsol
Copy link
Contributor

@adamsol adamsol commented Jun 12, 2021

Closes #1414.

Changelog-friendly one-liner: Fix pip-compile package ordering to match that of pip freeze.

Contributor checklist
  • Provided the tests for the changes.
  • Gave a clear one-line description in the PR (that the maintainers can add to CHANGELOG.md on release).
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@atugushev atugushev added bug fix writer Related to results output writer component labels Jun 12, 2021
@ssbarnea
Copy link
Member

I am a little bit against this change because it would break sorting using cli sort or editor sorting, which does the sorting line by line. In fact I would support pip freeze update to address this and making it compliant. I am wondering what others think.

@ssbarnea ssbarnea requested a review from atugushev June 15, 2021 15:20
@adamsol
Copy link
Contributor Author

adamsol commented Jun 15, 2021

I think that the current pip freeze's behaviour makes more sense, and generic sorting utilities aren't the right tool for this job anyway. I doubt anyone would expect or want the = character to take part in the sorting. And even ignoring the lexicographic order of package names, those utilities won't handle urls or comments in the file properly. Also note that the order of packages after running a line-by-line sort on requirements.in (without version specifiers) can be different than for the resulting requirements.txt.

@ssbarnea ssbarnea requested a review from jdufresne June 15, 2021 17:36
Copy link
Member

@atugushev atugushev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ssbarnea ssbarnea merged commit cb53648 into jazzband:master Jun 16, 2021
@nicoa nicoa added this to the 6.2.0 milestone Jun 16, 2021
@atugushev atugushev changed the title Fix pip-compile package ordering Fix pip-compile package ordering Jun 21, 2021
@adamsol adamsol deleted the fix-package-ordering branch July 18, 2021 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
writer Related to results output writer component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order of packages in requirements.txt -- pip-compile vs. pip freeze
4 participants