Skip to content

fix: Track Cython inputs for editable pixi-build-python builds (generated by Codex)#6123

Open
kkraus14 wants to merge 1 commit into
prefix-dev:mainfrom
kkraus14:codex/pixi-build-python-cython-inputs
Open

fix: Track Cython inputs for editable pixi-build-python builds (generated by Codex)#6123
kkraus14 wants to merge 1 commit into
prefix-dev:mainfrom
kkraus14:codex/pixi-build-python-cython-inputs

Conversation

@kkraus14
Copy link
Copy Markdown

@kkraus14 kkraus14 commented May 14, 2026

Track Cython inputs for editable pixi-build-python builds

Generated by Codex.

Summary

  • keep pure Python sources excluded from editable pixi-build-python input globs
  • include Cython inputs (.pyx, .pxd, .pxi) only when Cython is declared in the model dependencies or build-system.requires
  • use those Cython inputs to invalidate the source artifact cache when compiled editable builds change
  • update input-glob snapshots

Fixes #6122.

Tests

pixi run -e rust-test insta test -p pixi-build-python --accept -- input_globs
pixi run -e rust-test insta test -p pixi-build-python --check -- input_globs
pixi run -e rust-test cargo build -p pixi-build-python

Manual reproducer check:

Comment thread crates/pixi_build_python/src/main.rs Outdated
};
// Cython inputs affect compiled extension artifacts even when the
// Python package itself is installed editable.
let cython_globs = Vec::from(["**/*.{pyx,pxd,pxi}"]);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Also happy to just add these into the existing python_globs if you feel it's more appropriate

@kkraus14 kkraus14 changed the title Track Cython inputs for editable pixi-build-python builds (generated by Codex) fix: Track Cython inputs for editable pixi-build-python builds (generated by Codex) May 14, 2026
Copy link
Copy Markdown
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Would it be possible to add these only if cython is a dependency? Tracking globs has an overhead, seems wasteful to always add these if they will not match anyway.

@kkraus14 kkraus14 force-pushed the codex/pixi-build-python-cython-inputs branch from 269a68f to 2397f6b Compare May 14, 2026 05:44
@kkraus14
Copy link
Copy Markdown
Author

kkraus14 commented May 14, 2026

Addressed the review comment: Cython input globs are now added only when Cython is present in the model dependencies or in build-system.requires.

I also added tests for explicit model dependency, pyproject build-system dependency, and the no-Cython case.

Generated by Codex.

@kkraus14
Copy link
Copy Markdown
Author

kkraus14 commented May 14, 2026

Would it be possible to add these only if cython is a dependency? Tracking globs has an overhead, seems wasteful to always add these if they will not match anyway.

We were previously always tracking .pyx Cython files where this PR adds tracking .pxd and .pxi files as well, but happy to move all of them to only be tracked in the case of Cython being a dependency. This would be a change in behavior if someone is doing something funky where they're getting Cython outside of pixi's dependency system.

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.

Editable pixi-build-python Cython source package is not rebuilt after Cython input changes

2 participants