OZI - Package Python projects with Meson

raw JSON →
2.1.31 verified Fri May 01 auth: no python

OZI is a build system helper that wraps Meson to simplify packaging Python projects. It provides project scaffolding, dependency management, and automated builds for C extensions. Current version 2.1.31, requires Python 3.10-3.13. Active development with monthly releases.

pip install ozi
error ModuleNotFoundError: No module named 'ozi'
cause OZI not installed or installed in wrong environment.
fix
Run pip install ozi in your active environment.
error AttributeError: module 'ozi' has no attribute 'OZI'
cause Importing module instead of class.
fix
Use from ozi import OZI.
error OSError: [Errno 2] No such file or directory: '.../meson.build'
cause OZI v2 requires a pre-existing meson.build file.
fix
Create a meson.build file or use ozi scaffold to generate one.
breaking OZI v2 removes the `meson.build` template auto-generation; you must provide your own Meson configuration.
fix Migrate manually or use `ozi scaffold` to generate a new template.
deprecated The `OZI.dist()` method is deprecated since v2.1. Use `Project.build()` instead.
fix Replace `ozi.dist(...)` with `Project(proj_path).build(...)`.
gotcha OZI does not support Python 3.14 yet despite declaring `<3.14`. The version constraint actually limits to 3.13 max.
fix Use Python 3.10-.13 for now.

Initialize OZI and create a new project scaffold. Requires OZI_PROJECT_NAME environment variable.

from ozi import OZI
import os

# Initialize OZI with a project path
proj_path = os.path.expanduser('~/my_project')
ozi = OZI(proj_path)

# Create a new project scaffold
os.environ['OZI_PROJECT_NAME'] = 'example'
ozi.create_project()

print('Project created at', proj_path)