Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update pypi part #546

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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