Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reinstall if required is source and installed is from registry. #3131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ruben-arts
Copy link
Contributor

@ruben-arts ruben-arts commented Feb 13, 2025

When you switch from a registry package to a local source package, pixi should re-install it. This was previously not checked in the installation planner. This PR adds that check. But it doesn't fix the complete problem as we still get it from the cache afterward, so this PR is the first in a series to fix the problem of reinstallation completely.

Reproducer:
First pixi install this:

[project]
channels = ["conda-forge"]
name = "pixi_test"
platforms = ["osx-arm64"]

[tasks]
check = "python -c 'import yaml; print(yaml.__file__)'"

[dependencies]
python = ">=3.9,<3.14"

[pypi-dependencies]
pyyaml = "==6.0.2,<7"

Then clone the pyyaml package: git clone --branch 6.0.2 git@github.com:yaml/pyyaml.git
And modify the pixi.toml to:

[project]
channels = ["conda-forge"]
name = "pixi_test"
platforms = ["osx-arm64"]

[tasks]
check = "python -c 'import yaml; print(yaml.__file__)'"

[dependencies]
python = ">=3.9,<3.14"

[pypi-dependencies]
pyyaml = { path = "pyyaml", editable=false }

This will now throw the reinstall plan with:

 INFO pixi::install_pypi: re-installing 'pyyaml' because: 'Installed from registry from 'registry' but locked to a non-registry location from 'pyyaml''

This will then not correctly install it as it is using the wrong cache, but that will be fixed later 🤞

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.

1 participant