From d28f578c3e1f060b301dde24e1e040ff2e69c7d7 Mon Sep 17 00:00:00 2001 From: "Ruben Arts(win)" Date: Tue, 21 Nov 2023 10:51:37 +0100 Subject: [PATCH 1/2] docs: add pypi-dependencies to the configuration docs --- docs/configuration.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 5281bea7f..b866f814c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -231,18 +231,48 @@ package1 = { version = ">=1.2.3", build="py34_0" } ### `dependencies` Add any conda package dependency that you want to install into the environment. Don't forget to add the channel to the project table should you use anything different than `conda-forge`. +Even if the dependency defines a channel that channel should be added to the `project.channels` list. ```toml [dependencies] python = ">3.9,<=3.11" rust = "1.72" +pytoch-cpu = { version = "~=1.1", channel = "pytorch" } ``` -!!!note - All packages added to the `dependencies` table are also included as dependencies of the binary build by `pixi build`. +### `pypi-dependencies` (Beta feature) +Add any PyPI package that you want to install in the environment after the conda installation is finished. +These are not available on [prefix.dev](https://prefix.dev/channels) but on [pypi.org](https://pypi.org/). +!!! warning "Important considerations" + These packages are much more unstable than the conda variant. + So where possible use the conda packages in the `dependencies` table. + We're also not yet compatible with all features of `pip`. + Some notable missing features: - To only include certain packages in different stages of the build see [`build-dependencies`](#build-dependencies) and [`host-dependencies`](#host-dependencies). + - `git` dependencies + - Source dependencies + - Private PyPI repositories + - We only support the more modern wheel format for packages. + These dependencies don't follow the conda matchspec specification. + 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" +``` +??? info + We use [`rip`](https://github.com/prefix-dev/rip) which is our custom pypi package resolver. + The rip resolve step is run after the conda dependencies have been resolved. + As the conda packages can also install python packages, which are used in the rip resolver. + Also `rip` needs to know the version of python that is being used. ### `host-dependencies` From 4b8f15f38204a0635352b320abaea1a51bb3ba42 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Tue, 21 Nov 2023 11:08:05 +0100 Subject: [PATCH 2/2] docs: improve pypi documentation --- docs/configuration.md | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index b866f814c..624db7e15 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -244,18 +244,13 @@ pytoch-cpu = { version = "~=1.1", channel = "pytorch" } Add any PyPI package that you want to install in the environment after the conda installation is finished. These are not available on [prefix.dev](https://prefix.dev/channels) but on [pypi.org](https://pypi.org/). !!! warning "Important considerations" - These packages are much more unstable than the conda variant. - So where possible use the conda packages in the `dependencies` table. - We're also not yet compatible with all features of `pip`. - Some notable missing features: - - - `git` dependencies - - Source dependencies - - Private PyPI repositories - - We only support the more modern wheel format for packages. - - These dependencies don't follow the conda matchspec specification. - So see the example below to see what type of definition is allowed. + - **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 + - Source dependencies + - Private PyPI repositories + - **Version specification**: These dependencies don't follow the conda matchspec specification. + 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 @@ -268,10 +263,10 @@ torch = "*" # This means any version (this `*` is custom in pixi) pre-commit = "~=3.5.0" numpy = ">=1.20,<1.24" ``` -??? info +??? 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 run after the conda dependencies have been resolved. - As the conda packages can also install python packages, which are used in the rip resolver. + The `rip` resolve step is invoked after the conda dependencies have been resolved. + As the conda packages can also install python packages, which are used in the rip resolver. Also `rip` needs to know the version of python that is being used. ### `host-dependencies`