From 7187b6609188bc6128f04777f6ac9fea34907ece Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:21:36 +0200 Subject: [PATCH] [docs] Mention that project.name is required in pyproject.toml --- guide/src/metadata.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guide/src/metadata.md b/guide/src/metadata.md index 0ed7fbf19..b408c7d89 100644 --- a/guide/src/metadata.md +++ b/guide/src/metadata.md @@ -74,9 +74,11 @@ When the `[project]` section is not present, maturin will populate metadata from * `license` - From `package.license` in Cargo.toml * `project_url` - From various URLs in Cargo.toml (like repository, homepage, etc.) -When the `[project]` section is present, maturin will merge metadata from `Cargo.toml` and `pyproject.toml`, `pyproject.toml` takes precedence over `Cargo.toml`. +When the `[project]` section is present in `pyproject.toml`, it must contain at least the `name` field. +Maturin will then merge metadata from `Cargo.toml` and `pyproject.toml`, `pyproject.toml` takes precedence over `Cargo.toml`. Per specification, maturin is not allowed to populate fields that are not present in `project.dynamic` list when the `[project]` section is present. -For example, to use the Rust crate version as the Python package version, you need to add `version` to the `project.dynamic` list and so forth: +For example, to use the Rust crate version as the Python package version, you need to add `version` to the `project.dynamic` list. +To use `package.homepage` from `Cargo.toml`, add `urls` to `project.dynamic` and so forth: ```toml [project]