pyproject#

Minimal read-only access to the consuming repository’s pyproject.toml.

This is a small, dependency-light substitute for the full Pyproject utility in ComPWA/policy. The notebook hooks only need to read the package name and check whether a package is listed as a dependency.

get_package_name(*, raise_on_missing: bool = False) str | None[source]#

Get the package name from the [project] table.

has_dependency(package: str | tuple[str, ...]) bool[source]#

Check whether a package is listed as a dependency in pyproject.toml.

The [project] dependencies array, the [project.optional-dependencies] groups, and the [dependency-groups] are searched. Package names are compared after PEP 503 normalization.