Skip to main content
Pixi can read its configuration from pyproject.toml files, allowing Python projects to use a single manifest file for both Python packaging and pixi environment management.

Overview

When using pyproject.toml, all pixi configuration goes under the [tool.pixi] section. This allows seamless integration with Python build tools like setuptools, poetry, or hatchling.

Basic Structure

Configuration Sections

All sections from pixi.toml are available under [tool.pixi]:

Workspace Configuration

Dependencies

Tasks

Environments

Features

Complete Example

Here’s a complete pyproject.toml with both Python packaging and pixi configuration:

Editable Installation Pattern

A common pattern is to install the package itself in editable mode:
This makes the package available for import while allowing live code changes.

Migration from pixi.toml

To migrate from pixi.toml to pyproject.toml:
  1. Copy sections under [tool.pixi]:
  2. Rename [project] to [tool.pixi.project]:
  3. Add Python build config if needed:
  4. Test the migration:

Advantages

No need to maintain both pixi.toml and pyproject.toml. Everything in one place.
Works with standard Python build tools (pip, build, twine, poetry, hatch).
Easy to set up editable installs for development:
Can build and publish to PyPI while using pixi for development:

Limitations

Not all pixi features work in pyproject.toml. Notable limitations:
  • No [package] section for building conda packages (use pixi.toml for this)
  • Some tools may not understand [tool.pixi] sections
  • Schema validation may not work in all editors

Which Should I Use?

  • You’re building a Python package for PyPI
  • You want a single manifest file
  • Your project is primarily Python
  • You’re using Python build tools (setuptools, poetry, hatch)
  • You’re building conda packages
  • Your project uses multiple languages
  • You need the [package] section
  • You want better editor support for pixi-specific features
  • Your project is not primarily Python
You can have both files! Pixi will use pixi.toml if present, otherwise falls back to pyproject.toml.Useful for:
  • Publishing to both conda and PyPI
  • Separating concerns (packaging vs environment management)

Examples from Real Projects

Data Science Library

CLI Tool