### Pixi Build Editable Install Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Example demonstrating support for editable installs with `pixi build`. ```toml [project] name = "my-editable-package" version = "0.1.0" [build] editable = true ``` -------------------------------- ### Pixi PyPI Installation Unit Test Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Example related to proper unit testing for PyPI installation and fixing re-installation issues. ```python from pixi.pypi import install_pypi_package # Example usage: install_pypi_package("requests") ``` -------------------------------- ### CI/CD Setup with Pixi Auth for S3 Source: https://pixi.prefix.dev/v0.68.0/deployment/s3 GitHub Actions workflow example that configures AWS credentials and then uses them to authenticate Pixi for S3 access, passing credentials and host information to `setup-pixi`. ```yaml jobs: ci: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v4 # temporary credentials via OIDC - name: Log in to AWS uses: aws-actions/configure-aws-credentials@v4 id: aws with: role-to-assume: arn:aws:iam::123456789012:role/github-poweruser aws-region: eu-central-1 - name: Set up pixi # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set by aws-actions/configure-aws-credentials uses: prefix-dev/setup-pixi@v0.8.3 with: auth-s3-access-key-id: ${{ steps.aws.outputs.aws-access-key-id }} auth-s3-secret-access-key: ${{ steps.aws.outputs.aws-secret-access-key }} auth-s3-session-token: ${{ steps.aws.outputs.aws-session-token }} auth-host: s3://my-s3-bucket ``` -------------------------------- ### Set up pixi activation in Docker Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/shell-hook Example of setting up pixi activation in a Dockerfile to avoid needing the pixi executable after initial setup. This script is placed in /etc/profile.d/ to be sourced automatically. ```bash pixi shell-hook --shell bash > /etc/profile.d/pixi.sh rm ~/.pixi/bin/pixi # Now the environment will be activated without the need for the pixi executable. ``` -------------------------------- ### Update `install` CLI Documentation Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG The documentation for the `install` CLI command has been updated to provide clearer instructions and examples. ```bash pixi update `install` cli doc ``` -------------------------------- ### Install and sync dependencies Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Use `uv sync` to install or synchronize dependencies with uv, and `pixi install` for Pixi. ```bash uv sync ``` ```bash pixi install ``` -------------------------------- ### Install pixi-ros CLI Source: https://pixi.prefix.dev/v0.68.0/robotics Install the `pixi-ros` CLI tool globally to help quickstart ROS workspaces. This tool can initialize a workspace with correct RoboStack channels and ROS dependencies. ```bash # Install the pixi-ros CLI tool globally pixi global install pixi-ros # Move to your existing ros workspace that contains the src folder cd ros_ws # Initialize the workspace pixi ros init ``` -------------------------------- ### Install Package with Shortcut Source: https://pixi.prefix.dev/v0.68.0/global_tools/manifest Installs a package and adds a shortcut entry to the manifest. This makes the application appear in the start menu or be suggested for file type associations. ```bash pixi global install mss ``` ```toml [envs.mss] channels = ["https://prefix.dev/conda-forge"] dependencies = { mss = "*" } exposed = { ... } shortcuts = ["mss"] ``` -------------------------------- ### CI/CD Setup with AWS Credentials (OIDC) Source: https://pixi.prefix.dev/v0.68.0/deployment/s3 Example GitHub Actions workflow step to configure AWS credentials using OIDC and then set up Pixi. AWS credentials are automatically provided to Pixi. ```yaml jobs: ci: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v4 # temporary credentials via OIDC - name: Log in to AWS uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::123456789012:role/github-poweruser aws-region: eu-central-1 - name: Set up pixi # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set by aws-actions/configure-aws-credentials uses: prefix-dev/setup-pixi@v0.8.3 ``` -------------------------------- ### Run Constraints Example Source: https://pixi.prefix.dev/v0.68.0/reference/pixi_manifest Define version constraints for packages that might be installed if pulled in by another dependency. These do not force installation but constrain versions. ```toml [package.run-constraints] numpy = ">=2" ``` -------------------------------- ### Install environment with keyring provider Source: https://pixi.prefix.dev/v0.68.0/deployment/authentication Install your environment using `pixi install` with the `--pypi-keyring-provider` flag set to `subprocess` to enable keyring authentication. ```bash # From an existing pixi workspace pixi install --pypi-keyring-provider subprocess ``` -------------------------------- ### Test C++ Package Build and Execution Source: https://pixi.prefix.dev/v0.68.0/build/cpp Run this command to build the C++ bindings, install them, and execute the 'start' task defined in pixi.toml, which tests the 'add' function. ```bash $ pixi run start ``` -------------------------------- ### Global tool installation Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Install tools globally using `uv tool install ` for uv, or `pixi global install ` for Pixi. ```bash uv tool install ruff ``` ```bash pixi global install ruff ``` -------------------------------- ### Manual Extension Installation Steps Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/introduction Manually install an extension by downloading or building it, making it executable, and moving it to a directory in your system's PATH. ```bash # Download or build the extension curl -L https://github.com/user/pixi-myext/releases/download/v1.0.0/pixi-myext -o pixi-myext chmod +x pixi-myext mv pixi-myext ~/.local/bin/ ``` -------------------------------- ### Install keyring with general artifact support Source: https://pixi.prefix.dev/v0.68.0/deployment/authentication Install the `keyring` package with the `keyrings.artifacts` extra for general artifact registry authentication. ```bash pixi global install keyring --with keyrings.artifacts ``` -------------------------------- ### Install Tool with Shell Completions Source: https://pixi.prefix.dev/v0.68.0/global_tools/introduction Installs a tool globally. If the tool provides shell completions, they will be automatically installed and available. ```bash pixi global install git ``` -------------------------------- ### Install Local Package from File Path Source: https://pixi.prefix.dev/v0.68.0/concepts/package_specifications Install a pre-built package directly from the local filesystem by providing its absolute path. ```bash pixi add /path/to/package-1.0-hb0f4dca_0.conda ``` -------------------------------- ### Pixi Build Docs Pyproject.toml Setup Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Documentation related to `pyproject.toml` setup has been corrected for typos. ```markdown Fix typo in pyproject.toml setup documentation ``` -------------------------------- ### Pixi Build Docs UV Installer Selection Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Documentation for `pixi-build` has been updated to clarify the use of `uv` in installer selection. ```markdown Fix pixi-build docs about uv in installer selection ``` -------------------------------- ### Install Pixi on Windows Source: https://pixi.prefix.dev/v0.68.0 Install Pixi on Windows systems using PowerShell to download and execute the installation script. ```powershell powershell -ExecutionPolicy ByPass -c "irm -useb https://pixi.sh/install.ps1 | iex" ``` -------------------------------- ### Install Pixi with custom architecture Source: https://pixi.prefix.dev/v0.68.0/installation Installs Pixi using the installation script, forcing a specific architecture (e.g., x86_64 for Apple Silicon). ```bash curl -fsSL https://pixi.sh/install.sh | PIXI_ARCH=x86_64 bash ``` -------------------------------- ### Install pixi-pack and pixi-unpack globally Source: https://pixi.prefix.dev/v0.68.0/deployment/pixi_pack Install the pixi-pack and pixi-unpack tools globally using pixi. ```bash pixi global install pixi-pack pixi-unpack ``` -------------------------------- ### Install Package with Full Build String Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs a package by specifying the full build string, including the build hash and Python implementation. ```bash pixi global install "python [version='3.11.0', build=he550d4f_1_cpython]" ``` -------------------------------- ### Pixi Build Target to Workspace Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Example showing how to add a target to the workspace in pixi build. ```toml [workspace] targets = ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"] ``` -------------------------------- ### Replace Empty Default Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG The default example has been replaced with a 'no-default-feature' example to better illustrate environment configuration without default features. ```bash pixi replace empty default example with no-default-feature ``` -------------------------------- ### Install with a specific manifest path Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/install Installs the environment using a specified manifest file. This is useful when working with workspaces or non-standard project structures. ```bash pixi install --manifest-path ~/myworkspace/pixi.toml ``` -------------------------------- ### Install Pixi with wget (Linux/macOS) Source: https://pixi.prefix.dev/v0.68.0/installation Alternative installation method for Linux and macOS if curl is not available. Downloads and executes the installation script, adding Pixi to your PATH. ```bash wget -qO- https://pixi.sh/install.sh | sh ``` -------------------------------- ### Install Pixi with Winget Source: https://pixi.prefix.dev/v0.68.0/installation Installs Pixi using the Winget package manager on Windows. ```bash winget install prefix-dev.pixi ``` -------------------------------- ### Run Start Task with Pixi Source: https://pixi.prefix.dev/v0.68.0/tutorials/rust Execute the 'start' task using 'pixi run start'. This command compiles and runs your Rust project, typically displaying 'Hello, world!' for a new project. ```bash pixi run start ``` -------------------------------- ### Add Start Task to Pixi TOML Source: https://pixi.prefix.dev/v0.68.0/tutorials/rust Simplify running your project by adding a 'start' task to your pixi.toml. This maps 'pixi run start' to 'cargo run'. ```bash pixi task add start "cargo run" ``` -------------------------------- ### Pixi Build Introduction Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG This snippet is part of the introduction to pixi build, likely a basic configuration. ```toml [project] name = "my-project" version = "0.1.0" ``` -------------------------------- ### Global Install Command Usage Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Shows the general usage of the `pixi global install` command, including options and package arguments. ```bash pixi global install [OPTIONS] [PACKAGE]... ``` -------------------------------- ### Pixi Build ROS2 Tutorial Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG This snippet is part of a community example for ROS2 integration with pixi build. ```toml [project] name = "my-ros2-package" version = "0.1.0" [dependencies] ros2 = ">=2.0" ``` -------------------------------- ### Install Pixi Diff Tools Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_diff Installs the pixi-diff, pixi-diff-to-markdown, and glow tools globally using pixi. ```bash pixi global install pixi-diff pixi-diff-to-markdown glow-md ``` -------------------------------- ### Platform-Specific Configuration Examples Source: https://pixi.prefix.dev/v0.68.0/reference/pixi_manifest Provides examples of platform-specific configurations for activation scripts, dependencies, build dependencies, and tasks. This demonstrates how to tailor settings for 'win-64' and 'osx-64' targets. ```toml [target.win-64.activation] scripts = ["setup.bat"] [target.win-64.dependencies] msmpi = "~=10.1.1" [target.win-64.build-dependencies] vs2022_win-64 = "19.36.32532" [target.win-64.tasks] tmp = "echo $TEMP" [target.osx-64.dependencies] clang = ">=16.0.6" ``` -------------------------------- ### Install Multiple Packages Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs multiple packages at once. This is useful for setting up a common set of tools. ```bash pixi global install starship rattler-build ``` -------------------------------- ### Create a project with uv or Pixi Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Use `uv init` to create a new project with uv, or `pixi init` for Pixi. ```bash uv init myproject ``` ```bash pixi init myproject ``` -------------------------------- ### Install Pixi with Scoop Source: https://pixi.prefix.dev/v0.68.0/installation Installs Pixi using the Scoop package manager on Windows. ```bash scoop install main/pixi ``` -------------------------------- ### Simplest Environment Example Source: https://pixi.prefix.dev/v0.68.0/reference/pixi_manifest A minimal example of defining an environment named 'test' by simply listing its required feature. ```toml [environments] test = ["test"] ``` -------------------------------- ### Pixi Build Workspace Tutorial Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG This snippet is part of a tutorial for pixi build workspace, demonstrating its usage. ```toml [workspace] members = [ "packages/package1", "packages/package2", ] ``` -------------------------------- ### Pixi CI GitHub Actions Setup Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Integrate Pixi into GitHub Actions workflows using the `prefix-dev/setup-pixi` action. This action installs Pixi, sets up caching, and runs `pixi install`. ```yaml - uses: prefix-dev/setup-pixi@v0.8.8 ``` -------------------------------- ### Install with Dependencies Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs a package along with its specified dependencies. This ensures that all necessary components are available for the primary package to function correctly. ```bash pixi global install ipython --with numpy --with scipy ``` -------------------------------- ### Get Workspace Description Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/workspace/description/get Use this command to retrieve the current workspace description. No additional setup is required. ```bash pixi workspace description get ``` -------------------------------- ### Install pixi-skills Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_skills Install the pixi-skills package globally using the pixi package manager. ```bash pixi global install pixi-skills ``` -------------------------------- ### Dockerfile for Production Environment Source: https://pixi.prefix.dev/v0.68.0/workspace/multi_environment A Dockerfile example that uses a Pixi base image and installs only the production dependencies using the 'prod' environment. ```dockerfile FROM ghcr.io/prefix-dev/pixi:latest # this doesn't exist yet WORKDIR /app COPY . . RUN pixi run --environment prod postinstall EXPOSE 8080 CMD ["/usr/local/bin/pixi", "run", "--environment", "prod", "serve"] ``` -------------------------------- ### Install Global Tool from Local Path Source: https://pixi.prefix.dev/v0.68.0/global_tools/introduction Installs a Pixi package globally from a local source directory. Requires the source to have a pixi.toml manifest. ```bash pixi global install --path /path/to/cpp_math ``` -------------------------------- ### Display basic pixi info Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/info Use this command to get general information about your pixi setup. No additional flags are required for basic usage. ```bash pixi info ``` -------------------------------- ### Command Suggestion Example Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/introduction Pixi provides intelligent command suggestions for mistyped commands, showing the closest match from built-in commands and installed extensions. ```bash $ pixi pck error: unrecognized subcommand 'pck` tip: a similar subcommand exists: 'pack' ``` -------------------------------- ### Install keyring with Google Artifact Registry support Source: https://pixi.prefix.dev/v0.68.0/deployment/authentication Install the `keyring` package with the `keyrings.google-artifactregistry-auth` extra for Google Artifact Registry authentication. ```bash pixi global install keyring --with keyrings.google-artifactregistry-auth ``` -------------------------------- ### R Code Example Using ggplot2 Source: https://pixi.prefix.dev/v0.68.0/integration/editor/r_studio Execute this R code within an RStudio session launched from a pixi-managed environment to utilize installed packages like ggplot2. ```r # Load the ggplot2 package library(ggplot2) # Load the built-in 'mtcars' dataset data <- mtcars # Create a scatterplot of 'mpg' vs 'wt' ggplot(data, aes(x = wt, y = mpg)) + geom_point() + labs(x = "Weight (1000 lbs)", y = "Miles per Gallon") + ggtitle("Fuel Efficiency vs. Weight") ``` -------------------------------- ### Install pixi-install-to-prefix Globally Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_install_to_prefix Install the `pixi-install-to-prefix` tool globally to make it available for use. This allows you to run the command directly from your terminal. ```bash pixi global install pixi-install-to-prefix ``` -------------------------------- ### Python Tutorial: Dependencies, PyPI, Order, Grammar Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG The Python tutorial has been updated to cover dependencies, PyPI integration, ordering, and grammatical correctness. ```bash pixi python tutorial: dependencies, pypi, order, grammar ``` -------------------------------- ### Run Development Command with Cargo Source: https://pixi.prefix.dev/v0.68.0/build/dev Example of using `pixi run` to execute a command like `cargo run` after development dependencies have been installed via the `[dev]` table. ```bash pixi run cargo run ``` -------------------------------- ### Start a pixi shell in frozen mode Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/shell Opens a shell session where the environment is installed exactly as defined in the lockfile. This prevents modifications to the lockfile if it's not up-to-date with the manifest. ```bash pixi shell --frozen ``` -------------------------------- ### Running Pixi Task Source: https://pixi.prefix.dev/v0.68.0/build/python Executes the 'start' task defined in the Pixi manifest, which runs the 'rich-example-main' script. ```bash pixi run start ``` -------------------------------- ### Pixi Build Git Source Dependencies Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Example showing how to add support for Git source dependencies in pixi build. ```toml [dependencies] my-lib = { git = "https://github.com/example/my-lib.git", tag = "v1.0.0" } ``` -------------------------------- ### Install and Expose Specific Executable Source: https://pixi.prefix.dev/v0.68.0/global_tools/introduction Installs a package and exposes a specific executable under a custom name. Other executables from the package are not auto-exposed. ```bash pixi global install --expose py3=python "python=3.12" ``` -------------------------------- ### Install with Custom Environment and Exposed Binaries Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Demonstrates the new `pixi global` features for defining custom environment names and exposing specific binaries from dependencies under custom names. This allows for more granular control over global tool configurations. ```bash pixi global install \ --environment science \ --expose scipython=ipython \ ipython scipy ``` -------------------------------- ### Pixi TOML Configuration Example 3 Source: https://pixi.prefix.dev/v0.68.0/reference/environment_variables Shows the priority of local `activation.scripts` over activation scripts of dependencies. `LIB_PATH` will be set by the local script. ```toml [activation] scripts = ["local_setup.sh"] [dependencies] my-package = "*" # This package has its own activation scripts that set LIB_PATH="/dep/lib" ``` ```shell export LIB_PATH="/my/lib" ``` -------------------------------- ### Install Package with Exact Version and Build Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs a package using an exact version and build string, including the Python interpreter version. ```bash pixi global install python=3.11.0=h10a6764_1_cpython ``` -------------------------------- ### Display Pixi Info Source: https://pixi.prefix.dev/v0.68.0/advanced/explain_info_command Run `pixi info` to display comprehensive details about your Pixi installation, including version, platform, cache directories, and workspace/environment configurations. This is useful for debugging and understanding your current setup. ```bash ➜ pixi info Pixi version: 0.13.0 Platform: linux-64 Virtual packages: __unix=0=0 : __linux=6.5.12=0 : __glibc=2.36=0 : __cuda=12.3=0 : __archspec=1=x86_64 Cache dir: /home/user/.cache/rattler/cache Auth storage: /home/user/.rattler/credentials.json Workspace ------------ Version: 0.13.0 Manifest file: /home/user/development/pixi/pixi.toml Last updated: 25-01-2024 10:29:08 Environments ------------ default Features: default Channels: conda-forge Dependency count: 10 Dependencies: pre-commit, rust, openssl, pkg-config, git, mkdocs, mkdocs-material, pillow, cairosvg, compilers Target platforms: linux-64, osx-arm64, win-64, osx-64 Tasks: docs, test-all, test, build, lint, install, build-docs ``` -------------------------------- ### Authenticate and Upload Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/upload Demonstrates authenticating with a server using `pixi auth login` and then uploading a package. ```bash pixi auth login https://prefix.dev --token $MY_TOKEN pixi upload prefix --channel my-channel my_package.conda ``` -------------------------------- ### Example: Set Pixi Workspace Description Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/workspace/description/set This is an example of how to set a workspace description that includes spaces. Ensure the description is enclosed in double quotes. ```bash pixi workspace description set "My awesome workspace" ``` -------------------------------- ### Run Dependencies Example Source: https://pixi.prefix.dev/v0.68.0/reference/pixi_manifest List packages that are required to run the package on the target platform. This typically includes libraries and data files. ```toml [package.run-dependencies] rich = ">=13.9.4,<14" ``` -------------------------------- ### Run pixi-install-to-prefix with pixi exec Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_install_to_prefix Execute `pixi-install-to-prefix` within a temporary environment using `pixi exec`. This is an alternative to global installation and is useful for one-off operations. ```bash pixi exec pixi-install-to-prefix ./my-environment ``` -------------------------------- ### Control Pixi Installation with `--frozen` or `--locked` Source: https://pixi.prefix.dev/v0.68.0/integration/ci/github_actions Use the `locked` or `frozen` inputs to control whether `setup-pixi` runs `pixi install --locked` or `pixi install --frozen`. Defaults to `pixi install --locked` if `pixi.lock` exists, otherwise `pixi install`. ```yaml - uses: prefix-dev/setup-pixi@v0.9.4 with: locked: true # or frozen: true ``` -------------------------------- ### Install Direnv Globally Source: https://pixi.prefix.dev/v0.68.0/integration/third_party/direnv Install direnv using the pixi global install command. This makes direnv available system-wide. ```bash pixi global install direnv ``` -------------------------------- ### Example Pyproject.toml with Platform Configuration Source: https://pixi.prefix.dev/v0.68.0/workspace/multi_platform_configuration Shows how to configure supported platforms, default dependencies, and platform-specific overwrites using the pyproject.toml format. ```toml [tool.pixi.workspace] # Default workspace info.... # A list of platforms you are supporting with your package. platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] [tool.pixi.dependencies] python = ">=3.8" [tool.pixi.target.win-64.dependencies] # Overwrite the needed python version only on win-64 python = "~=3.7.0" [tool.pixi.activation] scripts = ["setup.sh"] [tool.pixi.target.win-64.activation] # Overwrite activation scripts only for windows scripts = ["setup.bat"] ``` -------------------------------- ### Pixi TOML Configuration Example 4 Source: https://pixi.prefix.dev/v0.68.0/reference/environment_variables Demonstrates that activation scripts of dependencies take priority over outside environment variables. `PYTHON_PATH` will be set by the dependency's activation script. ```toml # This example does not have a pixi.toml snippet, but implies a dependency setting PYTHON_PATH. # The following comment describes the scenario: # If we have a dependency that sets PYTHON_PATH and the same variable is already set in the outside environment. # When we run `echo Python path: $PYTHON_PATH`, it will output: # Python path: /pixi/python ``` -------------------------------- ### Automate Adding Install Scripts to Docs Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Install scripts are now automatically added to the documentation, ensuring that installation instructions are always up-to-date. ```bash pixi automate adding install scripts to the docs ``` -------------------------------- ### Install and Expose Packages in a Specific Environment Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs and exposes packages within a designated environment, ensuring consistency across installations. ```bash pixi global install --environment science --expose jupyter --expose ipython jupyter ipython polars ``` -------------------------------- ### Install Pixi with a specific version Source: https://pixi.prefix.dev/v0.68.0/installation Installs a specific version of Pixi using the installation script by setting the PIXI_VERSION environment variable. ```bash curl -fsSL https://pixi.sh/install.sh | PIXI_VERSION=v0.18.0 bash ``` -------------------------------- ### Authenticate with Token using setup-pixi Source: https://pixi.prefix.dev/v0.68.0/integration/ci/github_actions Use this to authenticate with prefix.dev using a bearer token. Store your token in GitHub secrets. ```yaml - uses: prefix-dev/setup-pixi@v0.9.4 with: auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} ``` -------------------------------- ### Install Pixi on Linux and macOS Source: https://pixi.prefix.dev/v0.68.0 Install Pixi on Linux and macOS systems by downloading and executing the installation script via curl. ```bash curl -fsSL https://pixi.sh/install.sh | sh ``` -------------------------------- ### Install environment in locked mode Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/install Checks if the lockfile is up-to-date with the manifest file before installing. The installation aborts if the lockfile is not up-to-date, ensuring consistency. ```bash pixi install --locked ``` -------------------------------- ### Initialize Pixi with pixi.toml Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Use this command to initialize Pixi in your project directory, creating a separate pixi.toml file. ```bash pixi init --format pixi ``` -------------------------------- ### Verify Linux-64 Package Architecture Source: https://pixi.prefix.dev/v0.68.0/build/cross_compilation Example output for a linux-64 package, showing its platform and subdirectory. ```bash "linux" "linux-64" ``` -------------------------------- ### Update Install Script in `pixi.sh` Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG The install script located in `pixi.sh` has been automatically updated to reflect the latest changes and ensure correct installation procedures. ```bash pixi automated update of install script in pixi.sh ``` -------------------------------- ### Install Source Dependencies with Pixi Global Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Use `pixi global install` to install source dependencies. Currently, the package name must be specified. ```bash pixi global install --path path/to/my-package my-package ``` -------------------------------- ### Install Only Pixi Binary Source: https://pixi.prefix.dev/v0.68.0/integration/ci/github_actions Set `run-install` to `false` to only install the Pixi binary without installing the current workspace. This is useful if you only need the Pixi executable itself. ```yaml - uses: prefix-dev/setup-pixi@v0.9.4 with: run-install: false ``` -------------------------------- ### Authenticate with Username and Password using setup-pixi Source: https://pixi.prefix.dev/v0.68.0/integration/ci/github_actions Use this for HTTP Basic Auth, typically for enterprise environments like Artifactory. Store credentials in GitHub secrets. ```yaml - uses: prefix-dev/setup-pixi@v0.9.4 with: auth-host: custom-artifactory.com auth-username: ${{ secrets.PIXI_USERNAME }} auth-password: ${{ secrets.PIXI_PASSWORD }} ``` -------------------------------- ### Install Pixi with PowerShell (Windows) Source: https://pixi.prefix.dev/v0.68.0/installation Installs Pixi on Windows using PowerShell. This command downloads and executes the installation script, adding Pixi to your PATH. ```powershell powershell -ExecutionPolicy Bypass -c "irm -useb https://pixi.sh/install.ps1 | iex" ``` -------------------------------- ### Install Packages with Equals Syntax Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs packages using the compact equals syntax for specifying versions and build strings. Use the `--channel` option to specify package sources. ```bash pixi global install "pytorch=*=*cuda*" --channel pytorch ``` ```bash pixi global install "jax=*=*cuda*" ``` -------------------------------- ### Pixi TOML Configuration Example 1 Source: https://pixi.prefix.dev/v0.68.0/reference/environment_variables Demonstrates the priority of `task.env` over `activation.env` for environment variables. When `HELLO_WORLD` is set in both, the value from `task.env` takes precedence. ```toml [tasks.hello] cmd = "echo $HELLO_WORLD" env = { HELLO_WORLD = "Hello world!" } [activation.env] HELLO_WORLD = "Activate!" ``` -------------------------------- ### Control Installation Behavior Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/add Use `--no-install` to only modify the lock file without installing. The `--frozen` flag installs the environment as defined in the lockfile, aborting if the lockfile is not up-to-date. The `--locked` flag checks if the lockfile is up-to-date before installing. ```bash pixi add --no-install ... ``` ```bash pixi add --frozen ... ``` ```bash pixi add --locked ... ``` -------------------------------- ### Initialize Pixi Project with pyproject.toml Source: https://pixi.prefix.dev/v0.68.0/python/tutorial Use this command to create a new Pixi project with a pyproject.toml manifest file. It sets up a basic project structure including source directories. ```bash pixi init pixi-py --format pyproject ``` -------------------------------- ### Install Single and Multiple Extensions Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/introduction Use `pixi global install` to add extensions to your Pixi environment. This command supports installing one or more extensions at a time. ```bash pixi global install pixi-pack # Install multiple extensions at once pixi global install pixi-pack pixi-diff ``` -------------------------------- ### Initialize Project and Add Python Source: https://pixi.prefix.dev/v0.68.0 Use this sequence to initialize a new Pixi project, add Python to its dependencies, and run a Python command. ```bash pixi init hello-world cd hello-world pixi add python pixi run python -c 'print("Hello World!")' ``` -------------------------------- ### Initialize Pixi Workspace Source: https://pixi.prefix.dev/v0.68.0/tutorials/rust Use this command to create a new pixi project directory and initialize the pixi.toml manifest file. ```bash pixi init my_rust_project cd my_rust_project ``` -------------------------------- ### Install specific packages with pixi Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Use `--only` to specify packages to install and `--skip` to exclude packages. This is useful for installing subsets of packages from conda and pypi. ```bash pixi install --only packageA --only packageB --skip packageC ``` -------------------------------- ### Install Package for a Specific Platform Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/global/install Installs a package for a specified platform. Note that running `osx-64` on Apple Silicon installs the Intel binary but runs it using Rosetta. ```bash pixi global install --platform osx-64 ruff ``` -------------------------------- ### Run pixi-browse Without Installation Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_browse Execute pixi-browse using 'pixi exec' without a global installation. This is useful for trying out the tool or for environments where global installations are restricted. ```bash pixi exec pixi-browse ``` -------------------------------- ### Install Multiple Tools Globally Source: https://pixi.prefix.dev/v0.68.0/global_tools/introduction Installs multiple tools into separate global environments without specifying an installation environment. This is useful for adding several CLI tools at once. ```shell pixi global install pixi-pack rattler-build ``` -------------------------------- ### Pixi Install-to-prefix Usage Source: https://pixi.prefix.dev/v0.68.0/integration/extensions/pixi_install_to_prefix This shows the command-line usage for `pixi-install-to-prefix`. It details the required prefix argument and available options for customization. ```bash Usage: pixi-install-to-prefix [OPTIONS] Arguments: The path to the prefix where you want to install the environment Options: -l, --lockfile The path to the pixi lockfile [default: pixi.lock] -e, --environment The name of the pixi environment to install [default: default] -p, --platform The platform you want to install for [default: ] -c, --config The path to the pixi config file. By default, no config file is used -s, --shell The shell(s) to generate activation scripts for. Default: see README --no-activation-scripts Disable the generation of activation scripts -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -h, --help Print help ``` -------------------------------- ### Pixi Global Tool Installation Source: https://pixi.prefix.dev/v0.68.0/switching_from/uv Install CLI tools globally in isolated environments using Pixi. This allows for installing non-Python tools as well, leveraging the conda ecosystem. ```shell pixi global install git bat ripgrep starship ``` -------------------------------- ### Initialize Project and Import Environment Source: https://pixi.prefix.dev/v0.68.0/tutorials/import Use `pixi init --import` to create a new project and import dependencies from a specified file. This command combines initialization and import, defaulting to the 'default' feature and environment. ```bash pixi init --import environment.yml ``` -------------------------------- ### Recommended Build-System Section using Hatchling Source: https://pixi.prefix.dev/v0.68.0/python/pyproject_toml A recommended `[build-system]` section using `hatchling`, which is a good starting point for most projects. Pixi defaults to `hatchling` when using `pixi init --format pyproject`. ```toml [build-system] build-backend = "hatchling.build" requires = ["hatchling"] ``` -------------------------------- ### Install a Tool Globally with Pixi Source: https://pixi.prefix.dev/v0.68.0/switching_from/conda Install a tool into a global, isolated environment using `pixi global install`. This is comparable to `pipx` or `condax` for making binaries available system-wide. ```bash pixi global install bat bat pixi.toml ``` -------------------------------- ### Add dependency without installing Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/add Adds a dependency to the manifest but does not install it immediately. ```bash pixi add --no-install numpy ``` -------------------------------- ### Initialize a Pixi Workspace Source: https://pixi.prefix.dev/v0.68.0/first_workspace Use `pixi init` to create a new workspace directory with a minimal manifest file. ```bash pixi init my_workspace ``` -------------------------------- ### Improve PyPI-Editable Installs Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Significant improvements have been made to the functionality and performance of PyPI-editable installs. ```bash pixi big improvements on the pypi-editable installs. ``` -------------------------------- ### Publishing to prefix.dev Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/publish This demonstrates publishing packages to a channel on prefix.dev. It includes options for specifying the target platform, generating attestations, and forcing overwrites. ```bash # Build and publish to your prefix.dev channel pixi publish https://prefix.dev/my-channel ``` ```bash # Build for a specific target platform and publish pixi publish https://prefix.dev/my-channel --target-platform linux-64 ``` ```bash # Publish with sigstore attestation for supply chain security pixi publish https://prefix.dev/my-channel --generate-attestation ``` ```bash # Force overwrite existing packages pixi publish https://prefix.dev/my-channel --force ``` -------------------------------- ### Pixi Build C++ Package Example Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG An example demonstrating how to build a C++ package using pixi build. This snippet is part of the pixi build preview work. ```toml [package] name = "my-cpp-package" version = "0.1.0" [build] # Add build specific configurations here if needed ``` -------------------------------- ### Pixi Environment Installation Speedup macOS Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Specific speedup for environment installation on macOS. ```text Speedup environment installation on macOS ``` -------------------------------- ### Initialize pixi with pyproject.toml format Source: https://pixi.prefix.dev/v0.68.0/reference/cli/pixi/init Creates a new workspace using the `pyproject.toml` manifest format. Choose this if you prefer adhering to the PEP 518 standard for project metadata. ```bash pixi init --format pyproject ``` -------------------------------- ### Prevent Removal of Non-Owned PyPI Installs Source: https://pixi.prefix.dev/v0.68.0/CHANGELOG Pixi will no longer remove PyPI installations that it does not own. ```toml # Example usage demonstrating this behavior would go here, but is not provided in the source. ``` -------------------------------- ### Initialize ROS 2 Workspace with Pixi Source: https://pixi.prefix.dev/v0.68.0/robotics Use this command to quickly set up a ROS 2 Humble workspace with Pixi. It initializes a new workspace, adds necessary channels, and installs the desktop environment. ```bash pixi init my_ros_ws -c https://prefix.dev/robostack-humble -c https://prefix.dev/conda-forge cd my_ros_ws pixi add ros-humble-desktop pixi run rviz2 ``` -------------------------------- ### Pixi Project Initialization Source: https://pixi.prefix.dev/v0.68.0/build/python Initializes a Pixi project, specifying the output format to be a 'pixi.toml' file. ```bash pixi init --format pixi ``` -------------------------------- ### Install Pixi with Homebrew Source: https://pixi.prefix.dev/v0.68.0/installation Installs Pixi using the Homebrew package manager on macOS. ```bash brew install pixi ```