[pull] main from astral-sh:main - #254
Merged
Merged
Conversation
## Summary When Git checks out symlinks as regular files, the `fake-uv` fixture cannot be installed because its `src` entry contains a link target instead of Python sources. We now copy the current Python sources into a temporary fixture for each Python module test, using a helper local to the test module. Closes #21850.
Move `uv add`'s project and script snapshots, error rollback, and Ctrl-C handling into a shared `ProjectEdit` guard. The caller commits the edit after locking and syncing succeeds. We retain the existing snapshot contents, modification check, and rollback boundary so other editing commands can adopt the interface separately.
An unchanged, read-only workspace manifest can prevent `uv add` from restoring an edited member after a failure. Frozen edits also read the lockfile unnecessarily and can fail when it is unreadable. Snapshot the affected files directly, skip unchanged files during rollback, and attempt each restoration independently. Frozen edits exclude the lockfile. We also guard edits before the first write, so errors before locking and syncing restore the files, and clear the snapshot on success so a later interrupt cannot undo a committed edit. Builds on #21859.
`uv version --bump minor --locked` leaves the version bumped when it rejects the stale lockfile. `uv remove` can similarly leave the manifest changed after locking or syncing fails. Use the shared project edit guard in `uv remove` and `uv version`, matching `uv add`'s rollback on errors and Ctrl-C. We restore the original manifest or script and lockfile, removing the lockfile if the failed command created it. Frozen edits continue to skip the lockfile. Builds on #21860. Closes #21854. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: astral-automations-bot[bot] <305554984+astral-automations-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )