Moving a dependency from `[pypi-dependencies]` to `[dependencies]` can silently delete its files from an existing environment
Checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
[workspace]
name = "flip"
channels = ["conda-forge"]
platforms = ["linux-64"]
[dependencies]
python = "3.14.*"
[pypi-dependencies]
pystac = "==1.15.2"
On PyPI, pystac is split across pystac-core + 22 pystac-ext-* distributions that own site-packages/pystac/; conda-forge ships it as one package. Install, then flip it to [dependencies] pystac = "==1.14.3" and re-run:
$ pixi lock && pixi install # warm, over the existing env
✔ The default environment has been installed.
$ pixi run python -c "import pystac"
ModuleNotFoundError: No module named 'pystac'
$ pixi list | grep '^pystac'
pystac 1.14.3 pyhd8ed1ab_0 135.46 KiB conda https://conda.anaconda.org/conda-forge
A same-named flip (e.g. click) is fine, and removing the PyPI dep without a conda replacement is fine — it needs both halves: a conda link plus a differently-named PyPI uninstall claiming the same paths.
Issue description
Moving a dependency from [pypi-dependencies] to [dependencies] and running pixi install over the existing environment can leave the package's files deleted while conda-meta and pixi list both say it's installed.
The removed PyPI distribution owns the same site-packages paths as the arriving conda package but under a different distribution name, so nothing connects the two. The conda package links first, then the PyPI uninstall walks the old RECORD and deletes the freshly-linked files.
Suggested Fix
The overlap accounting from #6292/#6344 looks reusable here: when unlinking a removed PyPI distribution, skip RECORD paths claimed by a conda package in the prefix's paths.json. Happy to open a PR for this.
Expected behavior
The warm install produces the same environment as a cold one: pystac 1.14.3 present and importable. The PyPI uninstall should leave any path alone once a conda package in the prefix claims it (per paths.json).
Great catch! @tdejager has this already crossed your view? I think this is an interesting issue which might require some logistic changes that I'm personally not too familiar with.
I reported this a while ago in #2203, and can confirm that it still exists. Also noted there that (EDIT: if you don't use pixi lock), running pixi install a second time will fix the package files.