Skip to content

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

Closed

Description

@kkraus14

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Pixi, using pixi --version.

Pixi Version

pixi 0.68.1

Motivation

In #3985 (comment), @tdejager mentioned that automatic rebuild/reinstall behavior is a feature Pixi is aiming for with the pixi build use case first. This issue tracks a narrower pixi-build-python/Cython case in that area, not general PyPI path dependencies.

Reproducer

tmpdir=$(mktemp -d)
cd "$tmpdir"

cat > pixi.toml <<'EOF'
[workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
preview = ["pixi-build"]

[dependencies]
source-rebuild-repro = { path = "." }

[tasks.show-doc]
cmd = ["python", "-c", "import repro; print(repro.answer.__doc__)"]

[package]
name = "source-rebuild-repro"
version = "0.1.0"

[package.build]
backend = { name = "pixi-build-python", version = "*" }

[package.build.config]
compilers = ["c"]

[package.host-dependencies]
python = "*"
setuptools = "*"
cython = "*"

[package.run-dependencies]
python = "*"
EOF

cat > pyproject.toml <<'EOF'
[build-system]
requires = ["setuptools", "cython"]
build-backend = "setuptools.build_meta"

[project]
name = "source-rebuild-repro"
version = "0.1.0"
EOF

cat > setup.py <<'EOF'
from setuptools import setup
from Cython.Build import cythonize

setup(ext_modules=cythonize("repro.pyx"))
EOF

cat > repro.pyx <<'EOF'
def answer():
    """v1"""
    return 1
EOF

pixi run show-doc
# prints: v1

python - <<'PY'
from pathlib import Path
p = Path("repro.pyx")
p.write_text(p.read_text().replace("v1", "v2"))
PY

pixi run show-doc
# actual:   v1
# expected: v2

pixi reinstall source-rebuild-repro
pixi run show-doc
# prints: v2

Expected Behavior

For editable local source packages built by pixi-build-python, changes to compiled Cython inputs such as .pyx, .pxd, or .pxi should invalidate the source artifact cache and trigger rebuild/reinstall before pixi run executes the task.

Unchanged inputs should continue to use the cached/installed artifact.

Actual Behavior

After changing repro.pyx, pixi run show-doc runs against the stale compiled extension and still prints v1. A manual pixi reinstall source-rebuild-repro is required before pixi run show-doc prints v2.

Notes

From local investigation, the core source artifact cache already invalidates on recorded input-file mtimes and newly matching globs. The issue appears to be that editable pixi-build-python builds do not currently record Cython inputs, so the cache sidecar misses the changed repro.pyx.

Activity

  1. changed the title [-]Local Pixi source package is not rebuilt/reinstalled by pixi run after source changes[/-] [+]Editable pixi-build-python Cython source package is not rebuilt after Cython input changes[/+] on May 14, 2026
  2. wolfv commented on May 14, 2026

    @wolfv
    Member

    Thank you @kkraus14 - we might have to change the globs to include the file types you mentioned here

    let base_globs = Vec::from([

    Alternatively, you might be able to work around this by adding extra_input_globs = [...] for the time being?

  3. kkraus14 commented on May 14, 2026

    @kkraus14
    ContributorAuthor

    I have a PR incoming with what I (and my Codex instance) believe is a fix for handling the Cython file types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions