pyproject-hooks

1.2.0 · active · verified Sat Mar 28

A low-level library for calling build-backends in pyproject.toml-based Python projects. Current version: 1.2.0, released on September 29, 2024. Maintained by Thomas Kluyver, it provides basic functionality to help write tooling that generates distribution files from Python projects. If you want a tool that builds Python packages, you'll want to use https://github.com/pypa/build instead. This is an underlying piece for pip, build, and other 'build frontends' use to call 'build backends' within them. Note: The pep517 project has been replaced by this project (low level) and the build project (high level).

Warnings

Install

Imports

Quickstart

A basic example demonstrating how to use BuildBackendHookCaller to call the 'build_sdist' hook from a pyproject.toml-based project.

import os
from pyproject_hooks import BuildBackendHookCaller

# Set the path to your pyproject.toml file
pyproject_toml_path = os.environ.get('PYPROJECT_TOML_PATH', 'pyproject.toml')

# Initialize the BuildBackendHookCaller
hook_caller = BuildBackendHookCaller(pyproject_toml_path)

# Call the build hook
hook_caller.call_hook('build_sdist')

view raw JSON →