Skip to content

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

@lebrice

Description

@lebrice

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions