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

feat: dont remove non pixi pypi installs #1043

Merged
merged 15 commits into from
May 7, 2024

Conversation

tdejager
Copy link
Contributor

@tdejager tdejager commented Mar 22, 2024

Check the INSTALLER when removing packages either through changing of dependencies or python version.

Fixes: #998

We now have the following behavior:

  • If the installer is not uv-pixi and not managed by pixi we do not touch the package.
  • If the installer is not uv-pixi but is managed by pixi we re-install.

Also, In the case where we switch python interpreters, which requires a new site-packages folder:

  • We leave the packages alone that do not have our installer

The problem is that for existing installs these have the wrong installer, which is all installs done with an older pixi version: when this PR is merged the installer will automatically be updated and the following warning is shown once:

E.g for an environment with python and flask from pypi:

 INFO pixi::install_pypi: These pypi-packages were re-installed because they were previously installed by a different installer but are currently managed by pixi:
        markupsafe, blinker, click, flask, itsdangerous, jinja2, werkzeug

Because we are essentially re-installing all pypi-packages in the environment.

This is a bit ugly, but I've noticed people being suprised that if they tinker in an environment a re-install occurs.

@tdejager tdejager requested a review from wolfv March 22, 2024 14:20
src/install_pypi.rs Outdated Show resolved Hide resolved
src/install_pypi.rs Show resolved Hide resolved
@ruben-arts ruben-arts enabled auto-merge (squash) March 22, 2024 15:26
@tdejager tdejager marked this pull request as draft March 22, 2024 15:48
auto-merge was automatically disabled March 22, 2024 15:48

Pull request was converted to draft

@tdejager
Copy link
Contributor Author

Before merging we need to re-think the logic a bit.

  1. When we want to install a package that was not managed by us, but is managed by us now, we should still re-install.
  2. Maybe add a warning when we find pypi packages that were not installed by us or something? So that people know that we've not touched those?

@wolfv
Copy link
Member

wolfv commented Mar 22, 2024

Two points:

  • when a package is installed (even by another package manager), but we want to install a different version of it, we should still remove it and install the pixi managed version (maybe with a warning?)
  • when users have an existing environment and update it might look ugly for the transition period. Maybe for one or two pixi releases, we should keep the uv handling as well?

@tadejsv
Copy link

tadejsv commented Apr 18, 2024

Any progress on this? @wolfv @tdejager

@tdejager
Copy link
Contributor Author

Not yet, we should revive this. Although you can now use git dependencies if you want 😀

tdejager and others added 2 commits April 30, 2024 11:43
src/install_pypi.rs Outdated Show resolved Hide resolved
@tdejager tdejager marked this pull request as ready for review May 6, 2024 14:13
@tdejager tdejager merged commit d0a3fd0 into prefix-dev:main May 7, 2024
24 checks passed
@tdejager tdejager deleted the feat/dont-remove-non-pixi-pypi branch May 7, 2024 09:52
@abey79
Copy link

abey79 commented May 7, 2024

Awesome!

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.

Pixi removing packages installed by uv not part of pixi.toml
6 participants