Pixi: Managing Python Environments

Excerpt

Pixi is a fast, modern, and reproducible package management tool for developers of all backgrounds.

Notes

pyproject.toml adapted and it is on testing phase:

[project]
authors = [{name = "Tomás Vírseda", email = "tomasvirseda@gmail.com"}]
dependencies = []
name = "KB4IT"
requires-python = ">= 3.12"
version = "0.7.20+build.18"
license = "GPL-3.0-or-later"
keywords = ["static-site-generator", "asciidoctor", "documentation"]
classifiers = [
 "Development Status :: 4 - Beta",
 "Environment :: Console",
 "Environment :: Web Environment",
 "Intended Audience :: Developers",
 "Intended Audience :: Information Technology",
 "Intended Audience :: System Administrators",
 "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
 "Natural Language :: English",
 "Operating System :: POSIX :: Linux",
 "Programming Language :: Python :: 3",
 "Topic :: Documentation",
 "Topic :: Software Development :: Documentation",
 "Topic :: Utilities",
]

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.pypi-dependencies]
kb4it = { path = ".", editable = true }

[tool.pixi.dependencies]
mako = ">=1.3.10,<2"
lxml = ">=6.0.2,<7"

[tool.pixi.tasks]
version = "kb4it --version"
myblog_force = "kb4it -L DEBUG build /home/t00m/tmp/myblog/config/repo.json -f"
myblog = "kb4it -L DEBUG build /home/t00m/tmp/myblog/config/repo.json"

Useful commands:

  • pixi install: Install an environment, both updating the pixi.lock file and installing the environment

  • pixi list: List the packages of the current workspace

  • pixi run {task name}: Runs task name in the pixi environment