Skip to content

Commit

Permalink
docs: update pypi part (#546)
Browse files Browse the repository at this point in the history
Closes #500
  • Loading branch information
ruben-arts authored Dec 7, 2023
1 parent d7052a0 commit 2046d82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ It will only add if the package with its version constraint is able to work with
##### Options

- `--manifest-path`: the path to `pixi.toml`, by default it searches for one in the parent directories.
- `--host`: Specify that it is a host dependency, important for building a package.
- `--build`: Specify that it is a build dependency, important for building a package.
- `--host`: Specifies a host dependency, important for building a package.
- `--build`: Specifies a build dependency, important for building a package.
- `--pypi`: Specifies a PyPI dependency, not a conda package.
Parses dependencies as [PEP508](https://peps.python.org/pep-0508/) requirements, supporting extras and versions.
See [configuration](configuration.md) for details.
- `--no-install`: Don't install the package to the environment, only add the package to the lock-file.
- `--platform (-p)`: The platform for which the dependency should be added. (Allowed to be used more than once)

Expand All @@ -48,6 +51,7 @@ pixi add "numpy>=1.22,<1.24"
pixi add --manifest-path ~/myproject/pixi.toml numpy
pixi add --host "python>=3.9.0"
pixi add --build cmake
pixi add --pypi requests[security]
pixi add --platform osx-64 --build clang
```

Expand Down
13 changes: 7 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,24 @@ These are not available on [prefix.dev](https://prefix.dev/channels) but on [pyp
!!! warning "Important considerations"
- **Stability**: PyPI packages might be less stable than their conda counterparts. Prefer using conda packages in the `dependencies` table where possible.
- **Compatibility limitations**: Currently, pixi doesn't support:
- `git` dependencies
- `git` dependencies (`git+https://github.com/package-org/package.git`)
- Source dependencies
- Private PyPI repositories
- **Version specification**: These dependencies don't follow the conda matchspec specification.
The `version` is a [`VersionSpecifier`](https://docs.rs/pep440_rs/0.3.12/pep440_rs/struct.VersionSpecifiers.html) and the `extras` are a list of `Strings`.
So see the example below to see what type of definition is allowed.
It is based on [pep440](https://peps.python.org/pep-0440/)


```toml
[dependencies]
python = ">=3.6" # Python is needed for the pypi dependencies!

[pypi-dependencies]
pytest = "==7.4.3"
torch = "*" # This means any version (this `*` is custom in pixi)
pre-commit = "~=3.5.0"
numpy = ">=1.20,<1.24"
pytest = "*" # This means any version (this `*` is custom in pixi)
pre-commit = "~=3.5.0" # Single string is of type VersionSpecifiers
requests = {version = ">= 2.8.1, ==2.8.*", extras=["security", "tests"]} # Using the map allows the user to add `extras`
```

??? info "We use `rip` not `pip`"
We use [`rip`](https://github.com/prefix-dev/rip) which is our custom pypi package resolver.
The `rip` resolve step is invoked after the conda dependencies have been resolved.
Expand Down

0 comments on commit 2046d82

Please sign in to comment.