Skip to main content

This project is intended to document dynamic-metadata support.

Project description

dynamic-metadata

Actions Status Documentation Status

PyPI version PyPI platforms

GitHub Discussion

[!WARNING]

This is still a WiP! The design may still change.

dynamic-metadata defines a plugin protocol that lets a Python build backend compute [project] fields (version, readme, dependencies, …) at build time. Plugins are configured as an ordered array of tables, [[tool.dynamic-metadata]], each naming a provider. Entries run in order, so a later entry sees every field an earlier entry produced.

A minimal example reads the version out of a file with the bundled regex plugin:

[build-system]
requires = ["...", "dynamic-metadata"]
build-backend = "..."

[project]
dynamic = ["description", "version"]

[[tool.dynamic-metadata]]
provider = "dynamic_metadata.regex"
field = "version"
input = "src/my_package/__init__.py"

Because entries run in order, a later one can reference an earlier result. Here the template plugin builds a description from the name and the version produced above:

[[tool.dynamic-metadata]]
provider = "dynamic_metadata.template"
field = "description"
result = "This is {project[name]}, version {project[version]}"

Your build backend must support dynamic-metadata for this to work. Build backends known to support this currently include:

  • scikit-build-core (1.0+)

If you have a build backend, it's easy to add support, you don't even need to depend on this project to do it.

The documentation is split by audience:

  • For users — configure plugins in pyproject.toml.
  • Bundled plugins — the plugins shipped with this package (ast, regex, template, from_file, static, readme_fragment, substitute, pin_installed).
  • For plugin authors — implement the hooks; no runtime dependency on this package required.
  • For backend authors — drive plugins from a build backend by calling the reference loader.
  • Reimplementing the loader — drive plugins without a dependency on this package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_metadata-0.5.0.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_metadata-0.5.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_metadata-0.5.0.tar.gz.

File metadata

  • Download URL: dynamic_metadata-0.5.0.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dynamic_metadata-0.5.0.tar.gz
Algorithm Hash digest
SHA256 273546d7d3a3a0bb064bf7569aa4ed848b25ea9fd354ea843e1df666ad262c0b
MD5 d54dfc5cbb36c4ad44146cf102a59e60
BLAKE2b-256 d822045c842bb28f032e4eb62e5dbc815f2b0a41803444c0bfda024d4e51a6ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_metadata-0.5.0.tar.gz:

Publisher: cd.yml on scikit-build/dynamic-metadata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynamic_metadata-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamic_metadata-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0340b8b6db20b82b18bdb2dbd41ee448e8a0587275fbab594d7a5de876dde67c
MD5 fcc183922fe299515ea39d8d7a7a3b32
BLAKE2b-256 3b8bb971c72d278885a9004970490fce526247e8b29bff4142ede9c9e62da931

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_metadata-0.5.0-py3-none-any.whl:

Publisher: cd.yml on scikit-build/dynamic-metadata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page