From 9cb54ad79792fdbe7018a509809ca8eefbb834c1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 21 Dec 2022 11:49:49 +1000 Subject: [PATCH] Ensure py.typed file added to _aqt folder in wheel Closes #2276 --- build/configure/src/aqt.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/configure/src/aqt.rs b/build/configure/src/aqt.rs index 6db85bf2b..3e88074bf 100644 --- a/build/configure/src/aqt.rs +++ b/build/configure/src/aqt.rs @@ -4,7 +4,7 @@ use ninja_gen::{ action::BuildAction, command::RunCommand, - copy::CopyFiles, + copy::{CopyFile, CopyFiles}, glob, hashmap, inputs, node::{CompileSass, EsbuildScript, TypescriptCheck}, python::{python_format, PythonTest}, @@ -90,6 +90,15 @@ fn build_generated_sources(build: &mut Build) -> Result<()> { }, }, )?; + // we need to add a py.typed file to the generated sources, or mypy + // will ignore them when used with the generated wheel + build.add( + "qt/aqt:py.typed", + CopyFile { + input: "qt/aqt/py.typed".into(), + output: "qt/_aqt/py.typed", + }, + )?; Ok(()) }