When running uv add fails to install the package, it is still added to the dependency array of pyproject.toml causing future invocations of uv add to fail as well.
Reproduction Steps
- Run
uv add pytorch in a blank project
- This will fail notifying you that
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
- Observe that the
pyproject.toml added it to the dependencies array despite this failure.
- When you then attempt to run
uv add torch as instructed, it will fail in the same way as pytorch is now in the dependency array.