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

Confusing behaviour when removing a pypi dependency with a specified version #1567

Open
2 tasks done
lebrice opened this issue Jul 4, 2024 · 3 comments
Open
2 tasks done
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers

Comments

@lebrice
Copy link

lebrice commented Jul 4, 2024

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.

Reproducible example

$ pixi add gym==0.26.2 --pypi
✔ Added gym==0.26.2
Added these as pypi-dependencies.
$ pixi remove gym
 WARN Dependency `gym` doesn't exist
✔ Removed gym
$ pixi remove gym==0.26.2
 WARN Dependency `gym` doesn't exist
✔ Removed gym
$ pixi remove gym==0.26.2 --pypi
✔ Removed gym==0.26.2
Removed these as pypi-dependencies.

Issue description

Related to #1312 and #1314 (I think)

I find it confusing (from a new user standpoint) that when adding a package from pypi (with a version string), it seems to be necessary to specify both the same version and the --pypi flag in order to remove it:

For example:

pixi add gym==0.26.2 --pypi
pixi remove gym
 WARN Dependency `gym` doesn't exist
✔ Removed gym

Adding the version number:

$ pixi remove gym==0.26.2
 WARN Dependency `gym` doesn't exist
✔ Removed gym==0.26.2

Finally, adding the version number and the --pypi flag seems to work correctly (but it shouldn't be necessary to do this, right?)

$ pixi remove gym==0.26.2 --pypi
✔ Removed gym==0.26.2
Removed these as pypi-dependencies.

Is this intended behaviour?

Expected behavior

$ pixi add gym==0.26.2 --pypi
✔ Added gym==0.26.2
Added these as pypi-dependencies.
$ pixi remove gym
✔ Removed gym==0.26.2
Removed these as pypi-dependencies.
@lebrice lebrice added the 🐞 bug Something isn't working label Jul 4, 2024
@olivier-lacroix
Copy link
Contributor

you should be able to remove a pypi dependency with
$ pixi remove gym --pypi

@lebrice
Copy link
Author

lebrice commented Jul 5, 2024

IMO it should be sufficient to just pixi remove gym no? Is there any case in which one should be allowed to have both conda and pipy versions of the same package installed?

@olivier-lacroix
Copy link
Contributor

The same package would indeed not make much sense. However, it could be different packages, but with identical names.

This being said, maybe pixi should try removing as pypi if the conda one is not found ?

@ruben-arts ruben-arts added ✨ enhancement Feature request 👋 good first issue Good for newcomers and removed 🐞 bug Something isn't working labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request 👋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants