Commit changes to workspace member TOML files#15142
Conversation
cf0e09c to
ce6da5c
Compare
ce6da5c to
cf0e09c
Compare
This is necessary to avoid conflicts between uv.lock requires-dist and pyproject.toml.
cf0e09c to
5eb5a76
Compare
|
This passed all CI when I rebased and pushed it earlier, including the build stage. Somebody re-triggered it after that and the build stage failed with a "suspended account" error. Rebasing again to see if it works this time. EDIT: passed again. |
|
@crabbit-git I tested this on an |
What are you trying to accomplish?
Fix issue #14937, at least to the extent that CI pipelines containing
uv sync --lockedno longer fail when workspace members (as opposed to top-levelpyproject.toml) have their dependencies updated by Dependabot.The problem appears to be that the implementation of PR #14627 achieves its dependency updates for workspace members by editing the member
pyproject.tomlfiles but not actually committing them because theirsupport_fileistrue. This is flawed because it results in therequires-distmetadata insideuv.lockbeing updated to match the edited requirements imposed by the TOML edits, which creates a conflict between the actually committed TOML anduv.lock, causing anyuv sync --lockedin CI pipelines to fail.There is another thing that might be wrong which affects the repo I noticed this happening in: as I said on the issue, I believe the TOML shouldn't even be getting touched for these kinds of updates when the versioning strategy is set to "bump versions when necessary", as opposed to the default "bump versions". It should therefore be updating the TOML files relatively infrequently. Instead, it seems that it is falling back to the default strategy, causing it to update the TOML (even though, due to the aforementioned bug, it never commits said TOML) every time it updates something in the lock file. This may be out of scope for the PR and may not even reside in this repo so I'm not going to try to address it here for the time being; the much more urgent problem is the CI failures caused by this mismatch between different parts of the lock file and between the lock file and the TOML.
How will you know you've accomplished your goal?
I manually replicated the approach taken by Dependabot against the uv repo that I noticed the problem in to verify that
uv sync --lockedpasses while the temp-edited inner .toml file exists but fails once it is purged (simulating Dependabot's flow failing to commit it due tosupport_file = true).Unfortunately, it appears that I will be unable to run the kind of testing I would prefer, because that would require x86 architecture and the only machine I currently have on hand is ARM. I'm therefore having to trust a mix of CI and manual sanity checking to confirm that this has worked and does not have unintended impact. If anybody has access to x86 and is able and willing to run the testing on their end (ideally including running the script to dry-run it on an example repo), I would be very grateful for the assist.
Checklist