Skip to content

Commit

Permalink
feat: add pixi upgrade (#2368)
Browse files Browse the repository at this point in the history
Design proposal: #912

Implementation in this PR:
```
# Resolve all the dependencies of the default feature without any constraints and installs the solved solution.
pixi upgrade 

# Resolve a specific dependency
pixi upgrade package

# Resolve multiple dependencies
pixi upgrade package_a package_b

# Upgrade all dependencies in a single feature
pixi upgrade --feature test

# Upgrade all dependencies except python and julia
pixi upgrade --exclude python --exclude julia

# Run upgrade logic without writing to disk
pixi upgrade --dry-run

# Run upgrade and get output in json format
pixi upgrade --json
```

This PR is important as it is not easy enough right now to update a full
setup with pixi as it automatically pins most of your dependencies to a
major or minor version.

---------

Co-authored-by: Ruben Arts <[email protected]>
  • Loading branch information
Hofer-Julian and ruben-arts authored Nov 6, 2024
1 parent d0ce1f9 commit 1be5f6d
Show file tree
Hide file tree
Showing 130 changed files with 1,701 additions and 1,167 deletions.
27 changes: 27 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,33 @@ pixi update --dry-run
pixi update --no-install boto3
```

## `upgrade`

The `upgrade` command checks if there are newer versions of the dependencies and upgrades them in the [manifest file](project_configuration.md).
`update` updates dependencies in the lock file while still fulfilling the version requirements set in the manifest.
`upgrade` loosens the requirements for the given packages, updates the lock file and the adapts the manifest accordingly.

##### Arguments

1. `[PACKAGES]...` The packages to upgrade, space separated. If no packages are provided, all packages will be upgraded.

##### Options
- `--manifest-path <MANIFEST_PATH>`: the path to [manifest file](project_configuration.md), by default it searches for one in the parent directories.
- `--feature <FEATURE> (-e)`: The feature to upgrade, if none are provided all features are upgraded.
- `--no-install`: Don't install the (solve) environment needed for solving pypi-dependencies.
- `--json`: Output the changes in json format.
- `--dry-run (-n)`: Only show the changes that would be made, without actually updating the manifest, lock file, or environment.

```shell
pixi upgrade
pixi upgrade numpy
pixi upgrade numpy pandas
pixi upgrade --manifest-path ~/myproject/pixi.toml numpy
pixi upgrade --feature lint python
pixi upgrade --json
pixi upgrade --dry-run
```

## `run`

The `run` commands first checks if the environment is ready to use.
Expand Down
Loading

0 comments on commit 1be5f6d

Please sign in to comment.