Skip to content

fix(pixi-build-python): clarify missing pyproject error#5922

Merged
ruben-arts merged 2 commits into
prefix-dev:mainfrom
lawrence3699:fix/missing-pyproject-error
Apr 23, 2026
Merged

fix(pixi-build-python): clarify missing pyproject error#5922
ruben-arts merged 2 commits into
prefix-dev:mainfrom
lawrence3699:fix/missing-pyproject-error

Conversation

@lawrence3699

Copy link
Copy Markdown
Contributor

Closes #5871

When pixi-build-python is used without a pyproject.toml, metadata loading currently fails with a raw file-open error while reading package metadata.

This changes the metadata provider to surface a dedicated error that states that pixi-build-python requires a pyproject.toml and points at the missing path.

Validation:

  • cargo fmt --all --check
  • cargo test -p pixi-build-python metadata::tests:: -- --nocapture

Copilot AI review requested due to automatic review settings April 19, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves UX for pixi-build-python by surfacing a dedicated, actionable error when a project is missing pyproject.toml, instead of bubbling up a low-level file I/O error during metadata loading.

Changes:

  • Added a MissingPyProjectToml MetadataError variant with a clearer message and diagnostic help text.
  • Updated manifest loading to map ErrorKind::NotFound to the new dedicated error.
  • Added a regression test asserting both the error variant and message content when pyproject.toml is absent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/pixi_build_python/src/metadata.rs Outdated
Comment thread crates/pixi_build_python/src/metadata.rs Outdated
@baszalmstra

Copy link
Copy Markdown
Contributor

Thanks this is a great ux improvement!

@baszalmstra

Copy link
Copy Markdown
Contributor

Perhaps one improvement would be if we could surface this error earlier, I think we could surface this in the first few lines of recipe generation. Because now the error still includes that it could read a certain metadata like the homepage. But the backend cannot work without a pyproject.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ruben-arts ruben-arts merged commit e7af0f7 into prefix-dev:main Apr 23, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The python build backend should return a clear error if a pyproject.toml is missing

4 participants