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 roll back changes to pyproject.toml if the automatic sync is cancelled #6818

Closed
akx opened this issue Aug 29, 2024 · 1 comment · Fixed by #7024
Closed

uv add should roll back changes to pyproject.toml if the automatic sync is cancelled #6818

akx opened this issue Aug 29, 2024 · 1 comment · Fixed by #7024
Assignees
Labels
bug Something isn't working projects Related to project management capabilities

Comments

@akx
Copy link
Contributor

akx commented Aug 29, 2024

uv 0.4.0, macOS.

A minimal code snippet that reproduces the issue:

$ uv init foo
$ cd foo
$ uv add pyobjc
💭 oh crud, I don't need every single pyobjc framework! that's a lot of framework!
^C
$ uv add pyobjc-core
💭 oh crud, it's still downloading all frameworks! what's happening?!
^C
$ cat pyproject.toml
[...]
dependencies = [
    "pyobjc",
    "pyobjc-core",
]
$

IOW, I'd expect that if I cancel the uv add operation (even if it's made up of add and implicit sync afterwards), pyproject.toml was back to the state it was before uv add.

@zanieb zanieb added bug Something isn't working projects Related to project management capabilities labels Aug 29, 2024
@charliermarsh
Copy link
Member

(We correctly do this if lock or sync fail, but not if the program is interrupted.)

@charliermarsh charliermarsh self-assigned this Sep 4, 2024
charliermarsh added a commit that referenced this issue Sep 4, 2024
## Summary

Not perfect, but an improvement at least for an interactive experience.

Closes #6818.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working projects Related to project management capabilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants