Repository navigation
refactor(api): type the add errors - #7416
Merged
Hofer-Julian merged 3 commits intoNov 2, 2026
Merged
Conversation
Part of prefix-dev#6707. This types `add_conda_deps` and `add_pypi_deps`, and aligns the remove error with the conventions used since. Both now save the manifest through the shared error that names it, and report a failure to restore the manifest after a failed update the same way. The remove error's lock file variant is no longer boxed, so its source can be downcast again. `resolve_platforms` now returns the manifest's typed "platform not found" error, which has the same message. | Before | After | |---|---| | ``dependency `{name}` was not found`` | dependency '{name}' was not found | | Cannot remove Python while PyPI dependencies exist. Please remove these PyPI dependencies first: {deps} | cannot remove 'python' while PyPI dependencies exist, with help Remove these PyPI dependencies first: {deps}. | | failed to save the manifest, caused by {io error} | failed to save '{manifest}', caused by {io error} | | {io error} | failed to save '{manifest}', caused by {io error} | | {io error} | failed to restore '{manifest}', caused by {io error} |
Part of prefix-dev#6707. When adding dependencies failed and restoring the manifest then failed too, only the restore error was reported. With a read-only workspace directory, `pixi add` reported that it could not write `pixi.toml`, but not that writing the lock file had failed first. The restore error now carries the original error as a related diagnostic.
Part of prefix-dev#6707. `WorkspaceMut::revert` always rewrote the manifest, even when the changes were never saved, unlike dropping a `WorkspaceMut`. With a read-only `pixi.toml`, a failed `pixi add` then reported that it could not restore the manifest instead of why the add failed.
lucascolley
force-pushed
the
type-pixi-api-add-errors
branch
from
October 30, 2026 16:41
aaa4871 to
c2a2774
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #6707. This types
add_conda_depsandadd_pypi_deps, and aligns the remove error with the conventions used since.Both now save the manifest through the shared error that names it, and report a failure to restore the manifest after a failed update the same way. The remove error's lock file variant is no longer boxed, so its source can be downcast again.
resolve_platformsnow returns the manifest's typed "platform not found" error, which has the same message.Two fixes, each in its own commit:
WorkspaceMut::revertalways rewrote the manifest, even when the changes were never saved, unlike dropping aWorkspaceMut. With a read-onlypixi.toml, a failedpixi addreported that it could not restore the manifest instead of why the add failed (e.g. writing the lock file).dependency `{name}` was not found