Skip to content

Conversation

@nichmor
Copy link
Contributor

@nichmor nichmor commented Sep 16, 2025

Fixes: #4187

Overview

A very simple fix for a funny problem!
The idea is that, if you store an un-normalized PyPI name pixi_demo in the pyproject.toml and then request to remove it with

pixi remove --pypi pixi_demo

You will not be able to because during the conversion from pixi_demo to pep requirement name, we normalized it, so we always lose the source name.

On the other hand, TomlDocument is raw loaded, without any normalisation - this means that we need to preserve the source of the requested name and use it to find it.

At the same time,

pixi remove --pypi pixi-demo

will not remove it from the manifest ( stored pixi_demo), because we never normalise names when loading TomlDocument ( which is expected )

@nichmor nichmor marked this pull request as draft September 16, 2025 09:03
@nichmor nichmor added the test:extra_slow Run the extra slow tests label Sep 16, 2025
@nichmor nichmor force-pushed the fix/uninstall-with-dash-in-the-name branch from 213f01e to 826199d Compare September 16, 2025 14:08
@nichmor nichmor marked this pull request as ready for review September 16, 2025 14:17
@lucascolley lucascolley added bug Something isn't working pypi Issue related to PyPI dependencies labels Sep 17, 2025
@lucascolley lucascolley changed the title feat: use source name for a package fix(pypi): use source name for a package Sep 17, 2025
@nichmor nichmor merged commit 581162f into prefix-dev:main Sep 17, 2025
113 of 147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pypi Issue related to PyPI dependencies test:extra_slow Run the extra slow tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(remove): pixi remove --pypi doesn't work for editable packages with "_" or "-" in their name

3 participants