Pixi Repositories
Pixi installs conda packages from conda channels and Python packages from a PyPI-compatible index.
A CloudRepo Python repository is a PyPI-compatible index, so Pixi reads your private Python packages
from it. Keep a channels line in pixi.toml pointing at the channel’s own host; CloudRepo hosts Python repositories, not conda channels.
Before you start
Section titled “Before you start”- A Python repository to install from. Creating a Repository explains how to make one.
- A repository token that covers it. Download packages is enough to install; publishing takes Download and publish packages. Repository Tokens shows how to create one. In
.netrc,loginis the email address that owns the token andpasswordis the token. - The index address,
https://your-org.mycloudrepo.io/repositories/your-repo/simple/. The repository’s Connection Settings page shows the URL with your organization and repository filled in. Add/simple/to the end. - Pixi. The behavior described on this page was observed with Pixi 0.81.0.
Connect Pixi
Section titled “Connect Pixi”1. Put the credential in ~/.netrc. Pixi reads it for any Python index host it finds there. Keep
the file private to your own user (chmod 600 ~/.netrc):
machine your-org.mycloudrepo.iologin you@example.compassword YOUR_REPOSITORY_TOKEN2. Name the index in pixi.toml. Give each private package its own index. A package that names an
index is looked up on that index, not on PyPI:
[pypi-dependencies]my-package = { version = "==1.0.0", index = "https://your-org.mycloudrepo.io/repositories/your-repo/simple/" }The same entry from the command line:
pixi add --pypi "my-package==1.0.0" --index https://your-org.mycloudrepo.io/repositories/your-repo/simple/3. Install. Run this in the same directory as pixi.toml:
pixi installExpected: Pixi solves the environment and installs my-package from your repository.
Pixi also reads the netrc named by the NETRC environment variable. Keep the token in the platform’s
secret store, expose it to the step as CLOUDREPO_TOKEN (and your email as CLOUDREPO_USERNAME), write the
netrc into a private temporary directory, point NETRC at it, and delete the directory when the step ends:
umask 077NETRC_DIR="$(mktemp -d)"trap 'rm -rf "$NETRC_DIR"' EXITecho "machine your-org.mycloudrepo.io login $CLOUDREPO_USERNAME password $CLOUDREPO_TOKEN" > "$NETRC_DIR/netrc"export NETRC="$NETRC_DIR/netrc"pixi installThe token is in the file and in the environment, never on a command line, and the file is gone when the step exits, so it does not stay behind on a runner that later jobs reuse. For how each CI system holds a secret, see CI/CD.
Troubleshooting
Section titled “Troubleshooting”Because my-package was not found in the package registry and you require my-package==1.0.0.
Pixi prints the same sentence when the package is missing and when the index answers 401 Unauthorized,
so a package you know is published usually means the credential did not arrive. Check, in order:
~/.netrc(or the fileNETRCnames) has amachineline that is exactlyyour-org.mycloudrepo.io, with nohttps://and no path.loginis the email address that owns the token,passwordis the token itself rather than your portal password, and the token has not expired or been revoked.- The
indexURL ishttps://your-org.mycloudrepo.io/repositories/your-repo/simple/with your repository’s name.
If those hold, test the credential on its own with the steps in Troubleshooting.
The package is in the repository and the token is right, but the repository is a different one. A
token reaches only the repositories it was created for. 403 Forbidden with scope_mismatch_repo means
the token does not include this repository. See
scope_mismatch_repo.