pixi icon indicating copy to clipboard operation
pixi copied to clipboard

`pixi add` with packages and workspaces

Open nichtmacho opened this issue 1 year ago • 1 comments

Based on this issue: https://github.com/prefix-dev/pixi/issues/2807

We find out with @ruben-arts that pixi add logic should be updated to take into account packages and workspace.

Quoting the comment as the new spec.

We want the user to have a comfortable CLI to add packages to both workspaces and packages.

A package can be added to [dependencies], [package.run-dependencies], [package.host-dependencies], [package.build-dependencies] and all it's target and feature(only on workspace) variants.

  • pixi add package-x: Has a little automation in it to simplify the UX for the user.
    • If there is a [workspace] then add the package-x to [dependencies]
    • If there is ONLY a [package] then add it to [package.run-dependencies], we do this for easier onboarding and UX comfort. (throwing an error here would result in a user needing to understand run vs host vs build before they can get something working).
  • pixi add package-x --host/--run/--build will add it to [package.{type}-dependencies] IF it already has a [package] table. Otherwise, throw an error.
  • pixi add package-x --workspace will skip the automation and throw an error if there is no [workspace]. Conflicts with --host --run --build.
  • pixi add --host --target unix will add it to [package.target.unix.host-dependencies]

nichtmacho avatar Jan 09 '25 10:01 nichtmacho

closing as duplicate

nichtmacho avatar Jan 09 '25 10:01 nichtmacho