-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Inconsistent Sort Direction in Lock File #6153
Comments
We've also started hitting this all the time recently and it's caused us a lot of CI issues as well. We're looking at a adding a custom post-processing step to make sure that the file is always in the same order, but would be nice if this was addressed in poetry of course. |
In case it's useful to anyone else here's a quick and dirty script to canonicalize the order of entries in |
This also affects PRs generated by Dependabot (e.g., this diff has lots of unrelated changes; in this case there are no extra spaces before |
if anyone cares enough to do anything about this, I reckon the relevant code is poetry/src/poetry/packages/locker.py Lines 588 to 596 in 35281d9
Putting a couple of |
One possible complication is that at least Dependabot uses the poetry/poetry/packages/locker.py Lines 572 to 580 in d2abf92
|
Maintainers have indicated that there will be no new 1.1 releases so you just have to play the long game: fix in master and trust that 1.2 will arrive, eventually. |
The fix was backported and released as https://github.com/python-poetry/poetry/releases/tag/1.1.15 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Ubuntu 20.04 LTS
Python version: 3.10.5
Poetry version: 1.1.14
Link to the contents of your pyproject.toml file: pyproject.toml
Issue
Today (August 11th, 2022), between 12:48 and 18:25 UTC
poetry lock --no-update
began producing inconsistent output on the samepyproject.toml
, breaking all of our CI pipelines. When run locally on Ubuntu 22.04 LTS,poetry lock --no-update
continues to consistently produce this poetry.lock. This is consistent with past runs on Ubuntu 22.04 LTS in CI and hence what I perceive to be the correct output. Here is a CI workflow on Ubuntu 20.04 LTS showing the diff (reproduced below) between the old (correct) and new (incorrect) output. The new output appears consistent across CI runs. Note that the new order of lines within[package.extras]
is reverse alphabetical order, and the new order of dependencies within each line is reversed with respect to the original order. One possible root cause may be that the lock command's sorting behavior is not fully self-contained (i.e., it's system dependent), and GitHub Actions rolled out a seemingly innocuous change to their ubuntu-20.04 image that exposed this preexisting bug. Note also that two spaces were added beforemetadata.python-versions
.The text was updated successfully, but these errors were encountered: