### Install lidar example dependencies Source: https://github.com/prefix-dev/pixi/blob/main/examples/rerun_example/lidar/README.md Install the necessary Python libraries for the lidar example by running the setup script in the examples directory. ```bash pip install -e examples/python/lidar ``` -------------------------------- ### Install and Run NuScenes Example Source: https://github.com/prefix-dev/pixi/blob/main/examples/rerun_example/nuscenes_dataset/README.md Commands to set up the environment, install dependencies, and execute the NuScenes dataset example. ```bash pip install --upgrade rerun-sdk # install the latest Rerun SDK git clone git@github.com:rerun-io/rerun.git # Clone the repository cd rerun git checkout latest # Check out the commit matching the latest SDK release ``` ```bash pip install -e examples/python/nuscenes_dataset ``` ```bash python -m nuscenes_dataset # run the example ``` ```bash python -m nuscenes_dataset --help ``` -------------------------------- ### CI and Local Commands for Test vs Production Setup Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_environment.md Provides example shell commands for running Pixi in a CI environment and locally, demonstrating how to install and execute tasks for development and testing. ```shell pixi run postinstall-e && pixi run test ``` -------------------------------- ### Build and Install Installer with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/examples/constructor-minimal/README.md Use `pixi run build` to build the installer and `pixi run start` to install it. Ensure pixi is available in your terminal. ```shell # Build the installer pixi run build ``` ```shell # Install the built installer pixi run start ``` -------------------------------- ### Install Package with Shortcuts Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/manifest.md Installs a package and automatically adds shortcuts if the package supports them, making the application appear in the start menu. ```shell pixi global install mss ``` -------------------------------- ### Get help for lidar example Source: https://github.com/prefix-dev/pixi/blob/main/examples/rerun_example/lidar/README.md Use the --help flag with the lidar example script to see available command-line options and customization possibilities. ```bash python -m lidar --help ``` -------------------------------- ### Initialize Project for Multi-Environment Setup Source: https://github.com/prefix-dev/pixi/blob/main/docs/tutorials/multi_environment.md Initialize a new Pixi project and navigate into its directory. This is a starting point for setting up different development, testing, and production environments. ```shell pixi init production_project cd production_project ``` -------------------------------- ### Local Development Command for Test vs Production Setup Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_environment.md Shows the command to run for local development, which includes installing editable dependencies and starting the development server. ```shell pixi run postinstall-e && pixi run dev ``` -------------------------------- ### Get Workspace Description Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/description.md Example of how to get the workspace description. This command retrieves the current description. ```bash pixi workspace description get ``` -------------------------------- ### Target-Specific Extra Installer Arguments Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends/pixi-build-python.md Configure extra arguments for the installer on a per-target basis. This example sets a specific build directory for win-64, overwriting the base configuration. ```toml [package.build.config] extra-args = ["-Cbuilddir=mybuilddir"] [package.build.target.win-64.config] extra-args = ["-Cbuilddir=foo"] ``` -------------------------------- ### Configure Pixi Installation via Environment Variables Source: https://github.com/prefix-dev/pixi/blob/main/docs/installation.md Examples of using environment variables to customize the installation process on Linux and macOS. ```shell curl -fsSL https://pixi.sh/install.sh | PIXI_ARCH=x86_64 bash ``` ```shell curl -fsSL https://pixi.sh/install.sh | PIXI_VERSION=v0.18.0 bash ``` ```shell curl -fsSL https://pixi.sh/install.sh | PIXI_BIN_DIR=/usr/local/bin PIXI_NO_PATH_UPDATE=1 bash ``` -------------------------------- ### Installing from a Local Path Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Install a package from a local directory using the 'path' field. Set 'editable = true' for editable mode installations, which is recommended. ```toml minimal-project = { path = "./minimal-project", editable = true} ``` -------------------------------- ### Set workspace description example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/description/set.md An example of how to set a workspace description using the CLI. ```bash pixi workspace description set "My awesome workspace" ``` -------------------------------- ### Pixi Install Warning for Unsupported Platform Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_platform_configuration.md Example output from `pixi install` when run on a platform not defined in the project's supported platforms. ```shell ❯ pixi install WARN Not installing dependency for (default) on current platform: (osx-arm64) as it is not part of this project's supported platforms. ``` -------------------------------- ### Pass Extra Arguments to the Installer Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends/pixi-build-python.md Provide extra arguments to the selected installer (uv or pip). This example shows passing a build directory setting to pip. ```toml [package.build.config] extra-args = ["-Cbuilddir=mybuilddir"] ``` -------------------------------- ### Select Pip as the Installer Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends/pixi-build-python.md Configure the build backend to use 'pip' for installing the built wheel. The selected installer is automatically added to host dependencies. ```toml [package.build.config] installer = "pip" ``` -------------------------------- ### Configure extra-args for R CMD INSTALL Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends/pixi-build-r.md Pass extra arguments to the R installation command, with examples for base and target-specific overrides. ```toml [package.build.config] extra-args = ["--no-multiarch", "--no-test-load"] ``` ```toml [package.build.config] extra-args = ["--no-multiarch"] [package.build.target.win-64.config] extra-args = ["--no-multiarch", "--no-test-load"] # Result for win-64: ["--no-multiarch", "--no-test-load"] ``` -------------------------------- ### Install and Execute pixi-browse Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_browse.md Commands to install the tool globally or execute it directly without permanent installation. ```bash pixi global install pixi-browse ``` ```bash pixi exec pixi-browse ``` -------------------------------- ### Install Environment with PyPI Keyring Provider Source: https://github.com/prefix-dev/pixi/blob/main/docs/deployment/authentication.md Install your environment using the `pixi install` command with the `--pypi-keyring-provider` flag set to `subprocess`. This enables keyring integration for PyPI package installations. ```shell # From an existing pixi workspace pixi install --pypi-keyring-provider subprocess ``` -------------------------------- ### Install from source Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/introduction.md Installs a package globally from a local path or a git repository. ```shell pixi global install --path /path/to/cpp_math ``` ```shell pixi global install --git https://github.com/ORG_NAME/cpp_math.git ``` -------------------------------- ### Install Build Backend Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends.md Install a build backend by adding it to the `package.build` section of your Pixi manifest file. ```toml [package.build] # Example: install pixi-build-python backend = "pixi-build-python" ``` -------------------------------- ### Example Output of Running a Rust Project with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/docs/tutorials/rust.md This is the expected output when running a newly initialized Rust project using `pixi run start`. ```shell pixi run start Hello, world! ``` -------------------------------- ### Multi-stage Docker Build with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/docs/deployment/container.md This example demonstrates a multi-stage Docker build. It uses a Pixi Docker image to install dependencies and then copies the production environment into a minimal Ubuntu base image. The `pixi shell-hook` is used to activate the environment without needing Pixi installed in the final production container. ```Dockerfile FROM ghcr.io/prefix-dev/pixi:0.70.2 AS build # copy source code, pixi.toml and pixi.lock to the container WORKDIR /app COPY . . # install dependencies to `/app/.pixi/envs/prod` # use `--locked` to ensure the lock file is up to date with pixi.toml RUN pixi install --locked -e prod # create the shell-hook bash script to activate the environment RUN pixi shell-hook -e prod -s bash > /shell-hook RUN echo "#!/bin/bash" > /app/entrypoint.sh RUN cat /shell-hook >> /app/entrypoint.sh # extend the shell-hook script to run the command passed to the container RUN echo 'exec "$@"' >> /app/entrypoint.sh FROM ubuntu:24.04 AS production WORKDIR /app # only copy the production environment into prod container # please note that the "prefix" (path) needs to stay the same as in the build container COPY --from=build /app/.pixi/envs/prod /app/.pixi/envs/prod COPY --from=build --chmod=0755 /app/entrypoint.sh /app/entrypoint.sh # copy your project code into the container as well COPY ./my_project /app/my_project EXPOSE 8000 ENTRYPOINT [ "/app/entrypoint.sh" ] # run your app inside the pixi environment CMD [ "uvicorn", "my_project:app", "--host", "0.0.0.0" ] ``` -------------------------------- ### Example of setting pixi version Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/requires-pixi/set.md A practical example showing how to set the minimum version to 0.42. ```bash pixi workspace pixi-minimum set 0.42 ``` -------------------------------- ### Example of unsetting a configuration key Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/config/unset.md A practical example showing how to unset the default-channels configuration. ```bash pixi config unset default-channels ``` -------------------------------- ### Install a global tool with uv Source: https://github.com/prefix-dev/pixi/blob/main/docs/switching_from/uv.md Installs a CLI tool globally using uv. This is analogous to `pixi global install`. ```shell uv tool install ruff ``` -------------------------------- ### Run the start task in Pixi Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Execute the 'start' task defined in the Pixi workspace. ```bash pixi run start ``` -------------------------------- ### Installing from a Direct URL Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Install a PyPI package directly from a URL pointing to a wheel or sdist file. ```toml pandas = {url = "https://files.pythonhosted.org/packages/3d/59/2afa81b9fb300c90531803c0fd43ff4548074fa3e8d0f747ef63b3b5e77a/pandas-2.2.1.tar.gz"} ``` -------------------------------- ### Install pixi-pack and pixi-unpack Source: https://github.com/prefix-dev/pixi/blob/main/docs/deployment/pixi_pack.md Install the pixi-pack and pixi-unpack tools globally using pixi. ```bash pixi global install pixi-pack pixi-unpack ``` -------------------------------- ### Global Install Command Usage Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/global/install.md This is the basic usage of the `pixi global install` command. It takes optional arguments and package names to install. ```bash pixi global install [OPTIONS] [PACKAGE]... ``` -------------------------------- ### Install a global tool Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/introduction.md Installs a package globally on the system. ```bash pixi global install rattler-build ``` -------------------------------- ### Quick Add Examples Source: https://github.com/prefix-dev/pixi/blob/main/docs/concepts/package_specifications.md Demonstrates basic commands for adding packages to a Pixi workspace. ```shell pixi add "regex=1.20230323" pixi add "numpy>=1.23,<1.25" pixi add "pandas=1.5.3" pixi add "python=3.11" ``` -------------------------------- ### Build Dependencies Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Example of defining build dependencies in a Pixi manifest TOML file. ```toml [package.build-dependencies] cmake = "*" gcc = "*" ``` -------------------------------- ### Quick Global Examples Source: https://github.com/prefix-dev/pixi/blob/main/docs/concepts/package_specifications.md Shows how to add packages to the global Pixi environment. ```shell pixi global add "black" pixi global add "ruff>=0.0.200" ``` -------------------------------- ### Install multiple tools Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/introduction.md Install multiple tools simultaneously without specifying an environment. ```shell pixi global install pixi-pack rattler-build ``` ```toml [envs.pixi-pack] channels = ["conda-forge"] dependencies= { pixi-pack = "*" } exposed = { pixi-pack = "pixi-pack" } [envs.rattler-build] channels = ["conda-forge"] dependencies = { rattler-build = "*" } exposed = { rattler-build = "rattler-build" } ``` -------------------------------- ### Quick Exec Examples Source: https://github.com/prefix-dev/pixi/blob/main/docs/concepts/package_specifications.md Illustrates executing commands with specific package versions in Pixi. ```shell pixi exec "python -m pip install ""requests==2.28.1""" pixi exec "python -m pip install ""numpy>=1.23,<1.25""" ``` -------------------------------- ### Install Multiple Extensions Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/introduction.md Installs multiple Pixi extensions simultaneously using `pixi global install`. This is efficient for adding several extensions at once. ```bash pixi global install pixi-pack pixi-diff ``` -------------------------------- ### Build and Install Pixi from Source Source: https://github.com/prefix-dev/pixi/blob/main/docs/installation.md Commands to build and install Pixi directly from the GitHub repository using Cargo. ```shell cargo install --locked --git https://github.com/prefix-dev/pixi.git pixi ``` ```shell cargo build cargo test ``` -------------------------------- ### Example of listing a specific configuration key Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/config/list.md Shows how to retrieve the value for a specific configuration key. ```bash pixi config list default-channels ``` -------------------------------- ### Install All Environments Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/install.md Installs all environments defined in your pixi project. This is a convenient way to set up your entire project environment at once. ```bash pixi install --all ``` -------------------------------- ### Run the lidar example Source: https://github.com/prefix-dev/pixi/blob/main/examples/rerun_example/lidar/README.md Execute the main Python script for the lidar example to visualize data. ```bash python -m lidar # run the example ``` -------------------------------- ### Run Pixi Install Task Locally Source: https://github.com/prefix-dev/pixi/blob/main/README.md For local development, run this task to install Pixi as 'pixid'. This avoids potential name conflicts with other Pixi installations. ```shell pixi run install-as pixid ``` -------------------------------- ### Install pixi-install-to-prefix Globally Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_install_to_prefix.md Installs the `pixi-install-to-prefix` tool globally using Pixi. This makes the command available system-wide. ```bash pixi global install pixi-install-to-prefix ``` -------------------------------- ### Example: Add a platform to the workspace Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/platform.md Demonstrates how to add a platform to the workspace file and update the lock file. ```bash pixi workspace platform add "my-platform" --subdir "/path/to/my-platform" ``` -------------------------------- ### Install a global tool Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/introduction.md Installs a CLI tool globally using Pixi. ```shell pixi global install git ``` -------------------------------- ### Host Dependencies Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Example of defining host dependencies in a Pixi manifest TOML file. ```toml [package.host-dependencies] "python" = "3.10.*" "openssl" = "3.*" ``` -------------------------------- ### Install pixi-skills Globally Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_skills.md Installs the pixi-skills package globally using the pixi package manager. This command is used for initial setup. ```bash pixi global install pixi-skills ``` -------------------------------- ### Install Executable Source: https://github.com/prefix-dev/pixi/blob/main/tests/data/pixi-build/ros-workspace/src/navigator_implicit/CMakeLists.txt Installs the built 'navigator_implicit' executable to the appropriate library directory. ```cmake install(TARGETS navigator_implicit DESTINATION lib/${PROJECT_NAME}) ``` -------------------------------- ### Windows 64-bit Target Configuration Examples Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Shows platform-specific configurations for activation scripts, dependencies, build dependencies, and tasks on Windows 64-bit systems. Useful for setting up environment-specific tools and commands. ```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" ``` -------------------------------- ### Install for a Specific Platform Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/install.md Installs the environment for a specified platform. A warning will be issued if the platform does not match the current machine. ```bash pixi install --platform ``` -------------------------------- ### Example of appending a channel Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/config/append.md Example command to append a channel to the default-channels configuration. ```bash pixi config append default-channels bioconda ``` -------------------------------- ### GitHub Actions CI Setup with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/docs/switching_from/uv.md Use this action to install Pixi, set up caching, and run `pixi install` in your GitHub Actions workflow. ```yaml - uses: prefix-dev/setup-pixi@v0.8.8 ``` -------------------------------- ### Configure multi-platform activation Source: https://github.com/prefix-dev/pixi/blob/main/docs/tutorials/ros2.md Example of setting up activation scripts for both Linux and Windows platforms. ```toml [workspace] platforms = ["linux-64", "win-64"] [activation] scripts = ["install/setup.sh"] [target.win-64.activation] scripts = ["install/setup.bat"] ``` -------------------------------- ### Initialize Pixi Workspace Source: https://github.com/prefix-dev/pixi/blob/main/README.md Use 'pixi init' to create a new workspace and 'cd' to navigate into it. This sets up the basic project structure. ```bash pixi init myworkspace cd myworkspace ``` -------------------------------- ### Add a start task for Node.js script Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Define a task named 'start' to execute the 'hello.js' script using Node.js. ```bash pixi task add start "node hello.js" ``` -------------------------------- ### Create an environment Source: https://github.com/prefix-dev/pixi/blob/main/docs/switching_from/poetry.md Commands to initialize a new project environment. ```bash poetry new myenv ``` ```bash pixi init myenv ``` -------------------------------- ### Platform-Specific Dependencies Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_platform_configuration.md Define dependencies that are only installed on a specific platform or use different versions across platforms. This example shows installing 'msmpi' only on Windows and a specific Python version. ```toml [dependencies] python = ">=3.8" [target.win-64.dependencies] msmpi = "*" python = "3.8" ``` -------------------------------- ### Run LLM Inference Example Source: https://github.com/prefix-dev/pixi/blob/main/examples/llama-index-inference/README.md Execute the local LLM inference example using the `pixi run start` command. This command initiates the process defined in the project's configuration. ```bash $ pixi run start ``` -------------------------------- ### Activation Scripts Priority Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/environment_variables.md Illustrates that local activation scripts have higher priority than activation scripts of dependencies. 'LIB_PATH' is set by the local 'local_setup.sh'. ```toml [activation] scripts = ["local_setup.sh"] [dependencies] my-package = "*" # This package has its own activation scripts that set LIB_PATH="/dep/lib" ``` ```bash export LIB_PATH="/my/lib" ``` -------------------------------- ### Execute R code with ggplot2 Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/editor/r_studio.md Example script to load libraries and generate a scatterplot using installed R packages. ```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") ``` -------------------------------- ### Manifest with Shortcuts Entry Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/manifest.md Example TOML manifest including a 'shortcuts' entry, indicating that shortcuts should be installed for the 'mss' package. ```toml [envs.mss] channels = ["https://prefix.dev/conda-forge"] dependencies = { mss = "*" } exposed = { ... } shortcuts = ["mss"] ``` -------------------------------- ### Installing Dependencies with Version Specifier Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/manifest.md This command shows how to install a package with a specific version constraint, which is then recorded in the manifest. ```shell pixi global install "python<3.12" ``` -------------------------------- ### Pixi Manifest with PyPI-Only Dependency Source: https://github.com/prefix-dev/pixi/blob/main/docs/concepts/conda_pypi.md Example of a pixi.toml file where a dependency ('numpy') is only specified in PyPI dependencies, leading to its installation as a PyPI package. ```toml [dependencies] python = ">=3.8" [pypi-dependencies] numpy = ">=1.21.0" ``` -------------------------------- ### Add a start task for Python script Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Define a task named 'start' that executes the 'hello.py' script using Python. ```bash pixi task add start python hello.py ``` -------------------------------- ### CLI Migration Examples Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/system_requirements.md Shows the equivalent commands for managing platform constraints using the new `pixi workspace platform` CLI, replacing the deprecated `pixi workspace system-requirements` commands. ```bash pixi workspace platform add linux-64 --cuda 12 ``` ```bash pixi workspace platform edit osx-arm64 --macos 13.5 ``` ```bash pixi workspace platform list ``` -------------------------------- ### Manifest with Automatically Exposed Executable Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/manifest.md Example TOML manifest demonstrating automatic exposure of the 'ansible' executable when 'ansible' is installed in the 'ansible' environment. ```toml [envs.ansible] channels = ["conda-forge"] dependencies = { ansible = "*" } exposed = { ansible = "ansible" } # (1)! ``` -------------------------------- ### Run pixi workspace version patch command Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/version/patch.md Use this command to increment the patch version of your workspace. No setup is required beyond having pixi installed. ```bash pixi workspace version patch ``` -------------------------------- ### Pixi Install to Prefix Usage Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_install_to_prefix.md Displays the help message for the `pixi-install-to-prefix` command, outlining its arguments and options for specifying installation targets and configurations. ```text 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 lock file [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 ``` -------------------------------- ### Verify pixi workspace version requirement Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/workspace/requires-pixi/verify.md Use this command to ensure your workspace is compatible with the required pixi version. No setup is needed beyond having pixi installed. ```bash pixi workspace requires-pixi verify ``` -------------------------------- ### Command Suggestion Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/introduction.md Illustrates Pixi's command suggestion feature when a subcommand is mistyped. Pixi suggests the closest available command, which can be a built-in or an installed extension. ```bash $ pixi pck error: unrecognized subcommand 'pck` tip: a similar subcommand exists: 'pack' ``` -------------------------------- ### Initializing a ROS Workspace with pixi-ros Source: https://github.com/prefix-dev/pixi/blob/main/docs/robotics.md The `pixi-ros` tool simplifies ROS workspace setup by initializing a `pixi.toml` file and adding necessary RoboStack channels. Ensure you are in your ROS workspace directory containing a `src` folder. ```shell # 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 ``` -------------------------------- ### Environment Variable Override for CUDA Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/system_requirements.md Example of using the `CONDA_OVERRIDE_CUDA` environment variable to set the `__cuda` version, useful for installing in environments that don't match declared virtual packages. ```bash CONDA_OVERRIDE_CUDA=11 ``` -------------------------------- ### Platform-Specific Binary Configuration Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/backends/pixi-build-rust.md Platform-specific binaries override the base configuration. This example shows how to configure binaries for a specific target, resulting in a different set of installed binaries for that target. ```toml [package.build.config] binaries = ["my-cli", "my-helper"] [package.build.target.linux-64.config] binaries = ["my-cli"] # Result for linux-64: only ["my-cli"] ``` -------------------------------- ### Configure, Build, and Start C++ SDL Project Source: https://github.com/prefix-dev/pixi/blob/main/examples/cpp-sdl/README.md Use these pixi commands to manage the build process for the C++ SDL application. Ensure pixi is installed and available in your terminal. ```shell pixi run configure ``` ```shell pixi run build ``` ```shell pixi run start ``` -------------------------------- ### Basic Build System Configuration Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Example of a basic build system configuration in a Pixi manifest TOML file. ```toml name = "my-package" version = "0.1.0" [package.build] backend = { name = "pixi-build-cmake", version = "0.*" } [package.build.config] # Base configuration applied to all platforms extra-args = ["-DCMAKE_BUILD_TYPE=Release"] ``` -------------------------------- ### Initialize a Pixi workspace for Python Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Initialize a new Pixi workspace named 'hello-world' and navigate into its directory. ```bash pixi init hello-world cd hello-world ``` -------------------------------- ### Basic Constraints in Pixi Manifest Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/pixi_manifest.md Define constraints for conda packages to restrict versions without requiring installation. This example shows a constraint on openssl to avoid vulnerable 1.x releases. ```toml [workspace] channels = ["conda-forge"] platforms = ["linux-64", "osx-arm64", "win-64"] [dependencies] # openssl will be pulled in transitively; this constraint # ensures we never end up with a vulnerable 1.x release. requests = ">=2.28" [constraints] openssl = ">=3.0" ``` -------------------------------- ### Activate Specific Pixi Environment with Multiple Environments Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/ci/github_actions.md When installing multiple Pixi environments, specify which environment to activate for subsequent job steps. This example activates 'py311' from a list of environments. ```yaml - uses: prefix-dev/setup-pixi@v0.9.6 with: environments: >- py311 py312 activate-environment: py311 ``` -------------------------------- ### Initialize a New Pixi Project Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Sets up a new project directory, adds Python as a dependency, and runs a Python command. ```shell pixi init hello-world cd hello-world pixi add python pixi run python -c 'print("Hello World!")' ``` -------------------------------- ### Wildcard Platform Selectors for Tasks Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_platform_configuration.md Use wildcard characters in target selectors to apply configurations to multiple platforms that match the pattern. This example applies 'test' and 'train' tasks to platforms starting with 'cuda-'. ```toml [workspace] platforms = [ { name = "cuda-win-64", platform = "win-64", cuda = "12" }, { name = "cuda-linux-64", platform = "linux-64", cuda = "12" }, "win-64", "linux-64", ] [target."cuda-*".tasks] test = "python test.py --cuda" train = "python train.py --cuda" ``` -------------------------------- ### Dockerfile for Production Pixi Application Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_environment.md A Dockerfile example for deploying a Pixi application. It uses a Pixi base image, copies the project, installs production dependencies, exposes the application port, and sets the entrypoint to run the production server. ```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"] ``` -------------------------------- ### Pixi Upload Example Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/upload.md An example demonstrating how to upload a package file to a specific channel using pixi upload. Ensure you are authenticated with `pixi auth login`. ```bash pixi upload "my-package-0.1.0-py39h06a4308_2.conda" --prefix "my-channel" ``` -------------------------------- ### Run Commands with Custom Bash Shell Wrapper Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/ci/github_actions.md Use a custom shell wrapper to execute commands within the Pixi environment without needing 'pixi run' for each command. This example runs Python version and installs a package. ```yaml - run: | python --version pip install --no-deps -e . shell: pixi run bash -e {0} ``` -------------------------------- ### Initialize and verify direnv Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/third_party/direnv.md Demonstrates the workflow for allowing a new .envrc file and verifying environment activation. ```shell $ cd my-project direnv: error /my-project/.envrc is blocked. Run `direnv allow` to approve its content $ direnv allow direnv: loading /my-project/.envrc ✔ Project in /my-project is ready to use! direnv: export +CONDA_DEFAULT_ENV +CONDA_PREFIX +PIXI_ENVIRONMENT_NAME +PIXI_ENVIRONMENT_PLATFORMS +PIXI_PROJECT_MANIFEST +PIXI_PROJECT_NAME +PIXI_PROJECT_ROOT +PIXI_PROJECT_VERSION +PIXI_PROMPT ~PATH $ which python /my-project/.pixi/envs/default/bin/python $ cd .. direnv: unloading $ which python python not found ``` -------------------------------- ### Minimal CMake Install Target Source: https://github.com/prefix-dev/pixi/blob/main/tests/data/pixi-build/env-config-target-cmake-test/CMakeLists.txt Define a simple install target using `install(CODE ...)` which executes a command upon installation. This is a basic way to add custom actions to the installation process. ```cmake install(CODE "message(\"Install completed\")") ``` -------------------------------- ### Install keyring for basic authentication Source: https://github.com/prefix-dev/pixi/blob/main/docs/deployment/authentication.md Install the keyring package for basic authentication with PyPI. This is the first step to enable keyring-based authentication. ```shell pixi global install keyring ``` -------------------------------- ### Add build dependencies Source: https://github.com/prefix-dev/pixi/blob/main/docs/tutorials/ros2.md Install colcon and setuptools to enable package building. ```shell pixi add colcon-common-extensions "setuptools<=58.2.0" ``` -------------------------------- ### Initialize a new Pixi workspace Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/cpp.md Create a new directory and initialize a basic pixi.toml file. ```bash pixi init cpp_math ``` -------------------------------- ### Verify global tool installations Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Check the installed versions of globally installed tools such as ansible, terraform, k9s, and make. ```shell ansible --version terraform --version k9s version make --version ``` -------------------------------- ### Install Pixi on Linux/macOS Source: https://github.com/prefix-dev/pixi/blob/main/docs/index.md Use this command to install Pixi on Linux and macOS systems by downloading and executing an installation script. ```bash curl -fsSL https://pixi.sh/install.sh | sh ``` -------------------------------- ### Full `pixi.toml` example with `[dev]` table Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/dev.md This is a comprehensive `pixi.toml` example demonstrating the use of the `[dev]` table. It includes runtime, build, and development dependencies, showcasing how packages listed in `[dev]` can bring in their own dependencies. ```toml [package] name = "my-rust-package" version = "0.1.0" authors = ["Your Name "] [dependencies] serde = "1.0" [build-dependencies] cmake = "3.22" [dev] # Development dependencies # These packages themselves are not installed, but their dependencies are. cargo = "1.65" # Example of a package that brings in python and bat python = "3.10" # Example of a package that brings in rust rust = "1.65" ``` -------------------------------- ### Run pixi-install-to-prefix with Pixi Exec Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_install_to_prefix.md Executes `pixi-install-to-prefix` within a temporary Pixi environment. This is an alternative to global installation. ```bash pixi exec pixi-install-to-prefix ./my-environment ``` -------------------------------- ### Install a Specific Environment Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/install.md Installs a particular environment by its name. This is useful when you have multiple environments defined in your project and want to install only one. ```bash pixi install --environment ``` -------------------------------- ### Install Global Tools Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/pixi_diff.md Installs `pixi-diff`, `pixi-diff-to-markdown`, and `glow-md` globally using `pixi global install`. These tools are available on conda-forge. ```bash pixi global install pixi-diff pixi-diff-to-markdown glow-md ``` -------------------------------- ### Install a package Source: https://github.com/prefix-dev/pixi/blob/main/docs/switching_from/poetry.md Commands to add dependencies to the project. ```bash poetry add numpy ``` ```bash pixi add numpy ``` ```bash pixi add --pypi numpy ``` -------------------------------- ### Install with Locked Lock File Check Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/install.md Installs the environment after verifying the lock file is up-to-date with the manifest. The installation aborts if the lock file is not current. ```bash pixi install --locked ``` -------------------------------- ### Install Global Environments with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/ci/github_actions.md Specify `global-environments` to install multiple environments, useful for tools required by `pixi install`. Caching can be enabled with `global-cache`. ```yaml - uses: prefix-dev/setup-pixi@v0.9.6 with: global-environments: | google-cloud-sdk keyring --with keyrings.google-artifactregistry-auth - run: | gcloud --version keyring --list-backends ``` -------------------------------- ### Install and Expose Executables in Global Environment Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/manifest.md Installs a package and exposes its executables under specified names. If no name is given, the original executable name is used. ```shell pixi global install --expose bird=bat bat ``` -------------------------------- ### Example Pixi Global Tree Command Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/global/tree.md An example of how to use the pixi global tree command to show dependencies for a specific environment, with an option to invert the view. ```bash pixi global tree --environment "my-env" -i "regex" ``` -------------------------------- ### List environment packages Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/variants.md Verify the installed packages and build strings for specific environments. ```pwsh $ pixi list --environment py311 Package Version Build Size Kind Source python 3.11.11 h9e4cc4f_1_cpython 29.2 MiB conda python cpp_math 0.1.0 py311h43a39b2_0 conda cpp_math python_rich 0.1.0 pyhbf21a9e_0 conda python_rich ``` ```pwsh $ pixi list --environment py312 Package Version Build Size Kind Source python 3.12.8 h9e4cc4f_1_cpython 30.1 MiB conda python cpp_math 0.1.0 py312h2078e5b_0 conda cpp_math python_rich 0.1.0 pyhbf21a9e_0 conda python_rich ``` -------------------------------- ### Minimal CMake Install Target Source: https://github.com/prefix-dev/pixi/blob/main/tests/data/pixi-build/env-config-invalid-test/CMakeLists.txt Use this to define a simple install target in CMake that prints a message when the installation process is complete. No external dependencies are required. ```cmake cmake_minimum_required(VERSION 3.20) project(env-invalid-test-cmake-app) # Minimal install target install(CODE "message(\"Install completed\")") ``` -------------------------------- ### Pixi Manifest Configuration (pixi.toml) Source: https://github.com/prefix-dev/pixi/blob/main/docs/workspace/multi_platform_configuration.md Example of a pixi.toml file demonstrating platform-specific configurations for dependencies and activation scripts. ```toml [workspace] # Default workspace info.... # A list of platforms you are supporting with your package. platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] [dependencies] python = ">=3.8" [target.win-64.dependencies] # Overwrite the needed python version only on win-64 python = "3.7" [activation] scripts = ["setup.sh"] [target.win-64.activation] # Overwrite activation scripts only for windows scripts = ["setup.bat"] ``` -------------------------------- ### Recommended Build System Configuration (hatchling) Source: https://github.com/prefix-dev/pixi/blob/main/docs/python/pyproject_toml.md A recommended starting point for the [build-system] section in pyproject.toml, utilizing hatchling as the build backend. ```toml [build-system] build-backend = "hatchling.build" requires = ["hatchling"] ``` -------------------------------- ### Install Single Extension Source: https://github.com/prefix-dev/pixi/blob/main/docs/integration/extensions/introduction.md Installs a single Pixi extension using the `pixi global install` command. This method provides isolated environments and automatic discovery. ```bash pixi global install pixi-pack ``` -------------------------------- ### Example pixi upload quetz Command Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/upload/quetz.md Example of uploading a package to a Quetz server. Authentication is handled via keychain or auth-file if API key is not provided. ```bash pixi upload quetz --url https://quetz.example.com --channel mychannel --api-key "my-api-key" ``` -------------------------------- ### Install a Pixi Environment Source: https://github.com/prefix-dev/pixi/blob/main/docs/reference/cli/pixi/install.md Use this command to install a specific environment defined in your pixi project. This command updates the lock file and installs the necessary packages for the environment. ```bash pixi install ``` -------------------------------- ### Install Conda Package Globally with Pixi Source: https://github.com/prefix-dev/pixi/blob/main/README.md Globally install conda packages into their own environments using 'pixi global install'. This is similar to tools like pipx or condax. ```bash pixi global install cowpy ``` -------------------------------- ### Configure Build System Backend Source: https://github.com/prefix-dev/pixi/blob/main/docs/build/getting_started.md Specify the build backend and its channels in the [package.build] section. This example uses 'pixi-build-python' for building Python packages. ```toml [package.build] backend = "pixi-build-python" channels = ["conda-forge"] ``` -------------------------------- ### Install dependencies for JupyterLite Source: https://github.com/prefix-dev/pixi/blob/main/examples/jupyterlab/Factoring.ipynb Installs the necessary packages for the interactive environment. ```python %pip install -q ipywidgets sympy ``` -------------------------------- ### Default Build System Configuration (setuptools) Source: https://github.com/prefix-dev/pixi/blob/main/docs/python/pyproject_toml.md This is the fallback build-system configuration used by Pixi if no [build-system] section is present in pyproject.toml. It relies on setuptools. ```toml [build-system] requires = ["setuptools >= 40.8.0"] build-backend = "setuptools.build_meta:__legacy__" ``` -------------------------------- ### Install specific output Source: https://github.com/prefix-dev/pixi/blob/main/docs/global_tools/introduction.md Installs a specific output from a multi-output package. ```shell pixi global install --path /path/to/package foobar ```