Ensure py.typed file added to _aqt folder in wheel

Closes #2276
This commit is contained in:
Damien Elmes 2022-12-21 11:49:49 +10:00
parent 298741117f
commit 9cb54ad797

View File

@ -4,7 +4,7 @@
use ninja_gen::{ use ninja_gen::{
action::BuildAction, action::BuildAction,
command::RunCommand, command::RunCommand,
copy::CopyFiles, copy::{CopyFile, CopyFiles},
glob, hashmap, inputs, glob, hashmap, inputs,
node::{CompileSass, EsbuildScript, TypescriptCheck}, node::{CompileSass, EsbuildScript, TypescriptCheck},
python::{python_format, PythonTest}, 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(()) Ok(())
} }