Skip to content
Open
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
70 changes: 70 additions & 0 deletions contents/docs/Pixi/Community.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
part: pixi
title: Community
description: Who is using pixi?
---
# Community

When you want to show your users and contributors that they can use pixi in your repo, you can use the following badge:

[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)

```
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)
```

!!!tip "Customize your badge"
To further customize the look and feel of your badge,
you can add `&style=<custom-style>` at the end of the URL.
See [the documentation on shields.io](https://shields.io/badges/endpoint-badge) for more info.

## Built using Pixi

- Deltares:
- [Ribasim](https://github.com/Deltares/Ribasim): Water resources model
- [Ribasim-NL](https://github.com/Deltares/Ribasim-NL): Ribasim water resources modeling in the Netherlands
- [iMOD Python](https://github.com/Deltares/imod-python): Make massive MODFLOW models
- [iMOD Coupler](https://github.com/Deltares/imod_coupler): Application for coupling hydrological kernels
- [iMOD Documentation](https://github.com/Deltares/iMOD-Documentation): Documentation of the iMOD suite.
- [Xugrid](https://github.com/Deltares/xugrid): Xarray and unstructured grids
- [Numba celltree](https://github.com/Deltares/numba_celltree): Celltree data structure for searching for points, lines, boxes, and cells (convex polygons) in a two dimensional unstructured mesh.
- [QGIS-Tim](https://github.com/Deltares/QGIS-Tim): QGIS plugin and utilities for TimML multi-layer analytic element model
- [Pandamesh](https://github.com/Deltares/pandamesh): From geodataframe to mesh
- [Wflow](https://github.com/Deltares/Wflow.jl): Hydrological modeling framework
- [HydroMT](https://github.com/Deltares/hydromt): Automated and reproducible model building and analysis
- [HydroMT SFINCS](https://github.com/Deltares/hydromt_sfincs): SFINCS plugin for HydroMT
- [PyFlwDir](https://github.com/Deltares/pyflwdir): Fast methods to work with hydro- and topography data in pure Python.
- USGS:
- [MODFLOW 6](https://github.com/MODFLOW-USGS/modflow6): USGS modular hydrological model
- QuantCo:
- [glum](https://github.com/quantco/glum): High performance Python GLMs with all the features!
- [tabmat](https://github.com/quantco/tabmat): Efficient matrix representations for working with tabular data
- [pixi-pack](https://github.com/quantco/pixi-pack): A tool to pack and unpack conda environments created with pixi
- [polarify](https://github.com/quantco/polarify): Simplifying conditional Polars Expressions with Python 🐍 🐻‍❄️
- [copier-template-python-open-source](https://github.com/quantco/copier-template-python-open-source): Copier template for python projects using pixi
- [datajudge](https://github.com/quantco/datajudge): Assessing whether data from database complies with reference information
- [ndonnx](https://github.com/quantco/ndonnx): ONNX-backed array library that is compliant with the Array API standard
- [multiregex](https://github.com/quantco/multiregex): Quickly match many regexes against a string
- [slim-trees](https://github.com/quantco/slim-trees): Pickle your ML models more efficiently for deployment 🚀
- [sqlcompyre](https://github.com/quantco/sqlcompyre): Compare SQL tables and databases
- [metalearners](https://github.com/quantco/metalearners): MetaLearners for CATE estimation
- [ndonnx](https://github.com/quantco/ndonnx): ONNX-backed array library that is compliant with the Array API standard
- [tabulardelta](https://github.com/quantco/tabulardelta): Simplify table comparisons
- [pydiverse.pipedag](https://github.com/pydiverse/pydiverse.pipedag): A library for data pipeline orchestration optimizing high development iteration speed
- [pydiverse.transform](https://github.com/pydiverse/pydiverse.transform): Pipe based dataframe manipulation library that can also transform data on SQL databases

- [pixi-pycharm](https://github.com/pavelzw/pixi-pycharm): Conda shim for PyCharm that proxies pixi
- [pixi-diff-to-markdown](https://github.com/pavelzw/pixi-diff-to-markdown): Generate markdown summaries from pixi update
- [jiaxiyang/cpp_project_guideline](https://github.com/jiaxiyang/cpp_project_guideline): Guide the way beginners make their c++ projects.
- [hex-inc/vegafusion](https://github.com/hex-inc/vegafusion): Serverside scaling of Vega and Altair visualizations in Rust, Python, WASM, and Java
- [pablovela5620/arxiv-researcher](https://github.com/pablovela5620/arxiv-researcher): Summarize PDF's and Arixv papers with Langchain and Nougat 🦉
- [HaoZeke/xtsci-dist](https://github.com/HaoZeke/xtsci-dist): Incremental `scipy` port using `xtensor`
- [jslorrma/keyrings.artifacts](https://github.com/jslorrma/keyrings.artifacts): Keyring backend that provides authentication for publishing or consuming Python packages to or from Azure Artifacts feeds within Azure DevOps
- [LFortran](https://github.com/lfortran/lfortran): A modern cross-platform Fortran compiler
- [Rerun](https://www.rerun.io/): Rerun is an SDK for building time aware visualizations of multimodal data.
- [conda-auth](https://github.com/conda-incubator/conda-auth): a conda plugin providing more secure authentication support to conda.
- [py-rattler](https://github.com/conda/rattler/tree/main/py-rattler): Build your own conda environment manager using the python wrapper of our Rattler backend.
- [array-api-extra](https://github.com/data-apis/array-api-extra): Extra array functions built on top of the Python array API standard.
- [marray](https://github.com/mdhaber/marray):
Masked versions of Python array API standard compatible arrays.
- [quantity-array](https://github.com/quantity-dev/quantity-array): Quantities with Python array API standard arrays.
37 changes: 37 additions & 0 deletions contents/docs/Pixi/FAQ.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
part: pixi
title: Frequently asked questions
description: What questions did we encounter more often?
---
## What is the difference with `conda`, `mamba`, `poetry`, `pip`

| Tool | Installs python | Builds packages | Runs predefined tasks | Has lock files builtin | Fast | Use without python |
|--------|-----------------|-----------------|-----------------------|-----------------------|------|------------------------------------------------------------------------|
| Conda | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Mamba | ✅ | ❌ | ❌ | ❌ | ✅ | [✅](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) |
| Pip | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Pixi | ✅ | 🚧 | ✅ | ✅ | ✅ | ✅ |
| Poetry | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |


## Why the name `pixi`
Starting with the name `prefix` we iterated until we had a name that was easy to pronounce, spell and remember.
There also wasn't a cli tool yet using that name.
Unlike `px`, `pex`, `pax`, etc.
We think it sparks curiosity and fun, if you don't agree, I'm sorry, but you can always alias it to whatever you like.

=== "Linux & macOS"
```shell
alias not_pixi="pixi"
```
=== "Windows"
PowerShell:
```powershell
New-Alias -Name not_pixi -Value pixi
```

## Where is `pixi build`
**TL;DR**: It's coming we promise!

`pixi build` is going to be the subcommand that can generate a conda package out of a pixi project.
This requires a solid build tool which we're creating with [`rattler-build`](https://github.com/prefix-dev/rattler-build) which will be used as a library in pixi.
202 changes: 202 additions & 0 deletions contents/docs/Pixi/advanced/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
---
part: pixi
title: Authenticate pixi with a server
description: Authenticate pixi to access private channels
---

You can authenticate pixi with a server like prefix.dev, a private quetz instance or anaconda.org.
Different servers use different authentication methods.
In this documentation page, we detail how you can authenticate against the different servers and where the authentication information is stored.

```shell
Usage: pixi auth login [OPTIONS] <HOST>

Arguments:
<HOST> The host to authenticate with (e.g. repo.prefix.dev)

Options:
--token <TOKEN> The token to use (for authentication with prefix.dev)
--username <USERNAME> The username to use (for basic HTTP authentication)
--password <PASSWORD> The password to use (for basic HTTP authentication)
--conda-token <CONDA_TOKEN> The token to use on anaconda.org / quetz authentication
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
-h, --help Print help
```

The different options are "token", "conda-token" and "username + password".

The token variant implements a standard "Bearer Token" authentication as is used on the prefix.dev platform.
A Bearer Token is sent with every request as an additional header of the form `Authentication: Bearer <TOKEN>`.

The conda-token option is used on anaconda.org and can be used with a quetz server. With this option, the token is sent as part of the URL following this scheme: `conda.anaconda.org/t/<TOKEN>/conda-forge/linux-64/...`.

The last option, username & password, are used for "Basic HTTP Authentication". This is the equivalent of adding `http://user:[email protected]/...`. This authentication method can be configured quite easily with a reverse NGinx or Apache server and is thus commonly used in self-hosted systems.

## Examples

Login to prefix.dev:

```shell
pixi auth login prefix.dev --token pfx_jj8WDzvnuTHEGdAhwRZMC1Ag8gSto8
```

Login to anaconda.org:

```shell
pixi auth login anaconda.org --conda-token xy-72b914cc-c105-4ec7-a969-ab21d23480ed
```

Login to a basic HTTP secured server:

```shell
pixi auth login myserver.com --username user --password password
```

## Where does pixi store the authentication information?

The storage location for the authentication information is system-dependent. By default, pixi tries to use the keychain to store this sensitive information securely on your machine.

On Windows, the credentials are stored in the "credentials manager". Searching for `rattler` (the underlying library pixi uses) you should find any credentials stored by pixi (or other rattler-based programs).

On macOS, the passwords are stored in the keychain. To access the password, you can use the `Keychain Access` program that comes pre-installed on macOS. Searching for `rattler` (the underlying library pixi uses) you should find any credentials stored by pixi (or other rattler-based programs).

On Linux, one can use `GNOME Keyring` (or just Keyring) to access credentials that are securely stored by `libsecret`. Searching for `rattler` should list all the credentials stored by pixi and other rattler-based programs.

## Fallback storage

If you run on a server with none of the aforementioned keychains available, then pixi falls back to store the credentials in an _insecure_ JSON file.
This JSON file is located at `~/.rattler/credentials.json` and contains the credentials.

## Override the authentication storage

You can use the `RATTLER_AUTH_FILE` environment variable to override the default location of the credentials file.
When this environment variable is set, it provides the only source of authentication data that is used by pixi.

E.g.

```bash
export RATTLER_AUTH_FILE=$HOME/credentials.json
# You can also specify the file in the command line
pixi global install --auth-file $HOME/credentials.json ...
```

The JSON should follow the following format:

```json
{
"*.prefix.dev": {
"BearerToken": "your_token"
},
"otherhost.com": {
"BasicHTTP": {
"username": "your_username",
"password": "your_password"
}
},
"conda.anaconda.org": {
"CondaToken": "your_token"
}
}
```

Note: if you use a wildcard in the host, any subdomain will match (e.g. `*.prefix.dev` also matches `repo.prefix.dev`).

Lastly you can set the authentication override file in the [global configuration file](./../reference/pixi_configuration.md).

## PyPI authentication
Currently, we support the following methods for authenticating against PyPI:

1. [keyring](https://pypi.org/project/keyring/) authentication.
2. `.netrc` file authentication.

We want to add more methods in the future, so if you have a specific method you would like to see, please let us know.

### Keyring authentication

Currently, pixi supports the uv method of authentication through the python [keyring](https://pypi.org/project/keyring/) library.

#### Installing keyring
To install keyring you can use pixi global install:

=== "Basic Auth"
```shell
pixi global install keyring
```
=== "Google Artifact Registry"
```shell
pixi global install keyring --with keyrings.google-artifactregistry-auth
```
=== "Azure DevOps Artifacts"
```shell
pixi global install keyring --with keyring.artifacts
```

For other registries, you will need to adapt these instructions to add the right keyring backend.

#### Configuring your project to use keyring

=== "Basic Auth"
Use keyring to store your credentials e.g:

```shell
keyring set https://my-index/simple your_username
# prompt will appear for your password
```

Add the following configuration to your pixi manifest, making sure to include `your_username@` in the URL of the registry:

```toml
[pypi-options]
index-url = "https://[email protected]/simple"
```

=== "Google Artifact Registry"
After making sure you are logged in, for instance by running `gcloud auth login`, add the following configuration to your pixi manifest:

```toml
[pypi-options]
extra-index-urls = ["https://oauth2accesstoken@<location>-python.pkg.dev/<project>/<repository>/simple"]
```

!!!Note
To find this URL more easily, you can use the `gcloud` command:

```shell
gcloud artifacts print-settings python --project=<project> --repository=<repository> --location=<location>
```

=== "Azure DevOps Artifacts"
After following the [`keyring.artifacts` instructions](https://github.com/jslorrma/keyrings.artifacts?tab=readme-ov-file#usage) and making sure that keyring works correctly, add the following configuration to your pixi manifest:

```toml
[pypi-options]
extra-index-urls = ["https://[email protected]/{organization}/{project}/_packaging/{feed}/pypi/simple/"]
```

#### Installing your environment
Either configure your [Global Config](../reference/pixi_configuration.md#pypi-config), or use the flag `--pypi-keyring-provider` which can either be set to `subprocess` (activated) or `disabled`:

```shell
# From an existing pixi project
pixi install --pypi-keyring-provider subprocess
```


### `.netrc` file

`pixi` allows you to access private registries securely by authenticating with credentials stored in a `.netrc` file.

- The `.netrc` file can be stored in your home directory (`$HOME/.netrc` for Unix-like systems)
- or in the user profile directory on Windows (`%HOME%\_netrc`).
- You can also set up a different location for it using the `NETRC` variable (`export NETRC=/my/custom/location/.netrc`).
e.g `export NETRC=/my/custom/location/.netrc pixi install`

In the `.netrc` file, you store authentication details like this:

```sh
machine registry-name
login admin
password admin
```
For more details, you can access the [.netrc docs](https://www.ibm.com/docs/en/aix/7.2?topic=formats-netrc-file-format-tcpip).
Loading