From 214e2888caaa40f6d4ca2fdf4d7bea2de3046d42 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 13 May 2022 15:35:27 +0800 Subject: [PATCH] Allow stubs-only mixed project layout --- Changelog.md | 1 + src/build_context.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 046fda271..f61865e17 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Allow use python interpreters from bundled sysconfig when not cross compiling in [#907](https://github.com/PyO3/maturin/pull/907) * Use setuptools-rust for bootstrapping in [#909](https://github.com/PyO3/maturin/pull/909) * Allow setting the publish repository URL via `MATURIN_REPOSITORY_URL` in [#913](https://github.com/PyO3/maturin/pull/913) +* Allow stubs-only mixed project layout in [#914](https://github.com/PyO3/maturin/pull/914) * Allow setting the publish user name via `MATURIN_USERNAME` in [#915](https://github.com/PyO3/maturin/pull/915) ## [0.12.15] - 2022-05-07 diff --git a/src/build_context.rs b/src/build_context.rs index 771b70359..7a27d8533 100644 --- a/src/build_context.rs +++ b/src/build_context.rs @@ -113,7 +113,9 @@ impl ProjectLayout { }; if python_module.is_dir() { - if !python_module.join("__init__.py").is_file() { + if !python_module.join("__init__.py").is_file() + && !python_module.join("__init__.pyi").is_file() + { bail!("Found a directory with the module name ({}) next to Cargo.toml, which indicates a mixed python/rust project, but the directory didn't contain an __init__.py file.", module_name) }