Skip to content

`pixi-inspect` is a pixi extension that analyzes a conda package (either from disk or stdin) and extracts metadata from its `index.json`.

License

Notifications You must be signed in to change notification settings

toprinse/pixi-inspect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixi-inspect

Conda Platform Conda Downloads

This project provides a command-line tool to inspect conda packages and extract metadata from their index.json file. It is designed to work well with Pixi and CI/CD workflows.

Description

pixi-inspect analyzes a conda package (either from disk or stdin) and extracts metadata from its index.json. It uses the rattler_package_streaming crate for robust extraction and parsing.

Installation

You can install pixi-inspect from conda-forge using pixi:

pixi global install pixi-inspect

Installation from source

Prerequisites

  • Rust 1.70+ and Cargo
  • Pixi (optional, for conda workflows)

Compilation

git clone https://gitlab.in2p3.fr/thibaut.oprinsen/pixi-inspect
cd pixi-inspect
cargo build --release

The binary will be available at target/release/pixi-inspect.

To use globally:

cp target/release/pixi-inspect ~/.local/bin/

Make sure ~/.local/bin/ is in your PATH.

Usage

Inspect a single package

pixi-inspect get-info /path/to/package.conda

Inspect a package from stdin

cat package.conda | pixi-inspect get-info -

Inspect all packages in a workspace (excluding .pixi)

find /path/to/workspace -path '/path/to/workspace/.pixi' -prune -o -name '*.conda' -exec pixi-inspect get-info {} \;

Inspect all packages in the current directory

find . -path './.pixi' -prune -o -name '*.conda' -exec pixi-inspect get-info {} \;

Help

pixi-inspect --help

Features

  • ✅ Extracts metadata from .conda and .tar.bz2 packages
  • ✅ Reads from file or stdin
  • ✅ Displays pretty-printed JSON
  • ✅ Robust error handling

Metadata Structure

A typical index.json looks like:

{
  "name": "package-name",
  "version": "1.0.0",
  "build": "py39h123456_0",
  "build_number": 0,
  "depends": ["python >=3.9", "numpy"],
  "platform": "linux-64",
  "license": "MIT",
  "timestamp": 1634567890,
  "size": 1234567
}

Code Architecture

src/
└── main.rs          # CLI entry point, extraction and parsing logic

Extraction and parsing are now handled directly in main.rs using rattler_package_streaming.

Use Cases

CI Integration

PACKAGE_VERSION=$(pixi-inspect get-info /path/to/package.conda | jq -r '.version')
echo "Package version: $PACKAGE_VERSION"

Dependency Analysis

pixi-inspect get-info /path/to/package.conda | jq -r '.depends[]'

About

`pixi-inspect` is a pixi extension that analyzes a conda package (either from disk or stdin) and extracts metadata from its `index.json`.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages