Skip to content

Commit bc46553

Browse files
committed
Makes sure to inject the module name
1 parent b5efccb commit bc46553

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ def test_introspection(session: nox.Session):
14391439
"import pyo3_pytests; print(pyo3_pytests.pyo3_pytests.__file__)",
14401440
silent=True,
14411441
).strip()
1442-
_run_cargo(session, "run", "-p", "pyo3-introspection", "--", lib_file, stub_dir)
1442+
_run_cargo(session, "run", "-p", "pyo3-introspection", "--", lib_file, "pyo3_pytests", stub_dir)
14431443
_run(session, "ruff", "format", stub_dir)
14441444
_ensure_directory_equals(Path(stub_dir), Path("pytests/stubs"))
14451445

pyo3-introspection/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::path::Path;
66
use std::{env, fs};
77

88
fn main() -> Result<()> {
9-
let [_, binary_path, output_path] = env::args().collect::<Vec<_>>().try_into().map_err(|_| anyhow!("pyo3-introspection takes two arguments, the path of the binary to introspect and the path of the directory to write the stub to"))?;
10-
let module = introspect_cdylib(&binary_path, "pyo3_pytests")
9+
let [_, binary_path, module_name, output_path] = env::args().collect::<Vec<_>>().try_into().map_err(|_| anyhow!("pyo3-introspection takes three arguments, the path of the binary to introspect, the name of the python module to introspect and and the path of the directory to write the stub to"))?;
10+
let module = introspect_cdylib(&binary_path, &module_name)
1111
.with_context(|| format!("Failed to introspect module {binary_path}"))?;
1212
let actual_stubs = module_stub_files(&module);
1313
for (path, module) in actual_stubs {

0 commit comments

Comments
 (0)