From 71f78253524a33fd294e2652581bb97688466a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Est=C3=A9vez?= Date: Mon, 18 Jul 2022 11:27:23 +0000 Subject: [PATCH] include pyproject.toml in cargo metadata args Consider the cargo options merged from the pyproject.toml when generating the cargo metadata. This fixes the following problem: if pyo3 is an optional dependency that is enabled through a feature declared in pyproject.toml, then maturin will not detect pyo3 as binding. --- Changelog.md | 1 + src/build_options.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index dd6c55621..c01f32ae2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add 64-bit RISC-V support by felixonmars in [#1001](https://github.com/PyO3/maturin/pull/1001) * Add support for invoking with `python3 -m maturin` in [#1008](https://github.com/PyO3/maturin/pull/1008) +* Fix detection of optional dependencies when declaring `features` in `pyproject.toml` in [#1014](https://github.com/PyO3/maturin/pull/1014) ## [0.13.0] - 2022-07-09 diff --git a/src/build_options.rs b/src/build_options.rs index d524d0a21..c80df2f98 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -580,7 +580,7 @@ impl BuildOptions { Vec::new() }; - let cargo_metadata_extra_args = extract_cargo_metadata_args(&self.cargo)?; + let cargo_metadata_extra_args = extract_cargo_metadata_args(&cargo_options)?; let result = MetadataCommand::new() .manifest_path(&manifest_file)