From 0e143c1acbd4420a9ba3677ba0f246fc41aea052 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 30 Dec 2024 14:33:07 +0100 Subject: [PATCH] Make invalid version info in `pyproject.toml` less fatal (#2417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR is a simple fix https://github.com/PyO3/maturin/issues/2416 by making invalid version information in `pyproject.toml` less fatal. Thank you for your great work on Maturin! 🍰 --- src/metadata.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index fda62c5b7..9483dcb5b 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -146,11 +146,11 @@ impl Metadata24 { self.name.clone_from(&project.name); if let Some(version) = &project.version { if dynamic.contains("version") { - bail!("`project.dynamic` must not specify `version` when `project.version` is present in pyproject.toml"); + eprintln!("⚠️ Warning: `project.dynamic` must not specify `version` when `project.version` is present in pyproject.toml"); } self.version = version.clone(); } else if !dynamic.contains("version") { - bail!("`project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list"); + eprintln!("⚠️ Warning: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list"); } if let Some(description) = &project.description {