Skip to content

Commit

Permalink
docs: add docs on pinning strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts committed Jul 4, 2024
1 parent 8b7f433 commit 7818ace
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ pixi add --no-lockfile-update numpy
pixi add --feature featurex numpy
```

!!! tip
If you want to use a non default pinning strategy, you can set it using [pixi's configuration](reference/pixi_configuration#pinning-strategy).
```
pixi config set pinning-strategy no-pin --global
```
The default is `semver` which will pin the dependencies to the latest major version or minor for `v0` versions.


## `install`

Installs an environment based on the [manifest file](project_configuration.md).
Expand Down
15 changes: 15 additions & 0 deletions docs/reference/pixi_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ detached-environments = "/opt/pixi/envs"

```

### `pinning-strategy`
The strategy to use for pinning dependencies when running `pixi add`.
The default is `semver` but you can set the following:

- `no-pin`: No pinning, resulting in an unconstraint dependency. `*`
- `semver`: Pinning to the latest version that satisfies the semver constraint. Resulting in a pin to major for most versions and to minor for `v0` versions.
- `exact-version`: Pinning to the exact version, `1.2.3` -> `==1.2.3`.
- `major`: Pinning to the major version, `1.2.3` -> `>=1.2.3, <2`.
- `minor`: Pinning to the minor version, `1.2.3` -> `>=1.2.3, <1.3`.
- `latest-up`: Pinning to the latest version, `1.2.3` -> `>=1.2.3`.

```toml title="config.toml"
pinning-strategy = "no-pin"
```

### `mirrors`
Configuration for conda channel-mirrors, more info [below](#mirror-configuration).

Expand Down

0 comments on commit 7818ace

Please sign in to comment.