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

Sequential addition of optional dependencies [new_extra] of a pypi dependency replaces [previous_extra] instead of appending to the list of extras #2890

Open
2 tasks done
seembha opened this issue Jan 13, 2025 · 1 comment
Labels
🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies 🗒️ configuration Issue related to configuration of project or global behavior 👩‍💻 cli Issue related to CLI

Comments

@seembha
Copy link

seembha commented Jan 13, 2025

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 pandas[excel] --pypi

adds the following to pixi.toml

[pypi-dependencies]
pandas = { version = ">=2.2.3, <3", extras = ["excel"] }

Now add another [extra]

> pixi add pandas[xml] --pypi

and pixi.toml gets updated to

[pypi-dependencies]
pandas = { version = ">=2.2.3, <3", extras = ["xml"] }

Issue description

This adds support for xml but removes support for excel and is not the expected behavior. The same unexpected behavior is also found for a python project (pyproject.toml).

Expected behavior

The expected behavior should be to append the newly added [extra] to the list of extras

[pypi-dependencies]
pandas = { version = ">=2.2.3, <3", extras = ["excel", "xml"] }

where excel support is preserved and xml support is added.

In short,

> pixi add pandas[excel] --pypi
> pixi add pandas[xml] --pypi

should behave like

> pixi add "pandas[excel, xml]" --pypi
@seembha seembha changed the title Sequential addition of optional dependencies [extras] of a pypi dependency replaces previous extra instead of appending to the list of extras Sequential addition of optional dependencies [new_extra] of a pypi dependency replaces [previous_extra] instead of appending to the list of extras Jan 13, 2025
@ruben-arts
Copy link
Contributor

Yes, we should fix this.

Uv behaves similarly, so let's stay close to their design with this.

@ruben-arts ruben-arts added 🐞 bug Something isn't working 🐍 pypi Issue related to PyPI dependencies 👩‍💻 cli Issue related to CLI 🗒️ configuration Issue related to configuration of project or global behavior labels Jan 17, 2025
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 🗒️ configuration Issue related to configuration of project or global behavior 👩‍💻 cli Issue related to CLI
Projects
None yet
Development

No branches or pull requests

2 participants