You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #2448, pixi can now read pypi dependencies (and add them to the relevant features) in a pyproject.toml manifest from:
the [project.dependencies] array
the [project.optional-dependencies] table
the [dependency-groups] table
the [tool.pixi.pypi-dependencies] table
However using pixi add --pypi will always add a pypi dependency to:
the [project.dependencies] array if no feature / the default feature is specified
the [dependency-groups] table if a non-default feature is specified
unless --editable or --platform flags are used, in which case, it will be added to the [tool.pixi.pypi-dependencies] table
We may consider adding an additional flag to pixi add --pypi to allow selecting the array / table where the dependency will be added.
We could:
Not add any argument, and let users edit the manifest when needed
Add a --location argument:
Setting --location to pixi would force adding the pypi dependency to the [tool.pixi.pypi-dependencies] table.
Setting --location to optional-dependencies would force adding the pypi dependency to the project.optional-dependencies table (this will only have an effect if a non-default feature is also specified).
extend the CLI with --optional-dependencies [OPTIONAL_GROUP] and --dependency-group [DEPENDENCY_GROUP]. using the --feature flag would add the dependency to the [tool.pixi.pypi-dependencies] table.
A few thoughts on pros & cons:
adding arguments (in option 2 or 3) creates argument(s) to the CLI that are valid only for a pyproject.toml manifest. This is not ideal in that regard, as (I believe?) this would be a (bad) first.
in option 2, specifying --location optional-dependencies would only do something if a non-default feature is also specified (an error or warning could be thrown). However, that option does keep --feature as a key parameter, irrespective of the manifest, limiting the divergence in API between pyproject.toml and pixi.toml manifests
in option 3, the API becomes simpler, but diverges more between pyproject.toml and pixi.toml manifests. Also, I feel it will become less clear to the user that using --optional-dependencies FEATURE, --dependency-group FEATURE or --feature FEATURE will do exactly the same thing from a pixi standpoint.
The text was updated successfully, but these errors were encountered:
Problem description
With #2448, pixi can now read pypi dependencies (and add them to the relevant features) in a
pyproject.toml
manifest from:[project.dependencies]
array[project.optional-dependencies]
table[dependency-groups]
table[tool.pixi.pypi-dependencies]
tableHowever using
pixi add --pypi
will always add a pypi dependency to:[project.dependencies]
array if no feature / the default feature is specified[dependency-groups]
table if a non-default feature is specified[tool.pixi.pypi-dependencies]
tableWe may consider adding an additional flag to
pixi add --pypi
to allow selecting the array / table where the dependency will be added.We could:
--location
argument:--location
topixi
would force adding the pypi dependency to the[tool.pixi.pypi-dependencies]
table.--location
tooptional-dependencies
would force adding the pypi dependency to the project.optional-dependencies table (this will only have an effect if a non-default feature is also specified).--optional-dependencies [OPTIONAL_GROUP]
and--dependency-group [DEPENDENCY_GROUP]
. using the--feature
flag would add the dependency to the[tool.pixi.pypi-dependencies]
table.A few thoughts on pros & cons:
pyproject.toml
manifest. This is not ideal in that regard, as (I believe?) this would be a (bad) first.--location optional-dependencies
would only do something if a non-default feature is also specified (an error or warning could be thrown). However, that option does keep--feature
as a key parameter, irrespective of the manifest, limiting the divergence in API betweenpyproject.toml
andpixi.toml
manifestspyproject.toml
andpixi.toml
manifests. Also, I feel it will become less clear to the user that using--optional-dependencies FEATURE
,--dependency-group FEATURE
or--feature FEATURE
will do exactly the same thing from a pixi standpoint.The text was updated successfully, but these errors were encountered: