diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1494395ff..15cd1bd99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,8 @@ jobs: pypy3 -m pip install --force-reinstall --no-index --find-links test-crates/pyo3-pure/target/wheels pyo3-pure pypy3 -m pip install pytest pypy3 -m pytest test-crates/pyo3-pure/test_pyo3_pure.py + + cargo run -- pep517 build-wheel -i pypy3 -m test-crates/pyo3-pure/Cargo.toml --cargo-extra-args="-vv" - uses: actions/setup-python@v2 with: python-version: "3.10.0" diff --git a/src/build_context.rs b/src/build_context.rs index af782185e..44f9194ea 100644 --- a/src/build_context.rs +++ b/src/build_context.rs @@ -211,7 +211,9 @@ impl BuildContext { .cloned() .collect(); let mut built_wheels = Vec::new(); - built_wheels.extend(self.build_binding_wheel_abi3(&cpythons, *major, *minor)?); + if !cpythons.is_empty() { + built_wheels.extend(self.build_binding_wheel_abi3(&cpythons, *major, *minor)?); + } if !pypys.is_empty() { println!( "⚠️ Warning: PyPy does not yet support abi3 so the build artifacts will be version-specific. \ diff --git a/src/build_options.rs b/src/build_options.rs index f99966186..80244beeb 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -766,7 +766,20 @@ pub fn find_interpreter( Ok(interpreter) } else if generate_abi3_import_lib { println!("🐍 Not using a specific python interpreter (Automatically generating windows import library)"); - Ok(Vec::new()) + // fake a python interpreter + Ok(vec![PythonInterpreter { + major: *major as usize, + minor: *minor as usize, + abiflags: "".to_string(), + target: target.clone(), + executable: PathBuf::new(), + ext_suffix: ".pyd".to_string(), + interpreter_kind: InterpreterKind::CPython, + abi_tag: None, + libs_dir: PathBuf::new(), + platform: None, + runnable: false, + }]) } else { bail!("Failed to find a python interpreter"); } diff --git a/src/main.rs b/src/main.rs index ce332c491..e8217dab7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -329,7 +329,8 @@ fn run() -> Result<()> { if !no_sdist { build_context.build_source_distribution()?; } - build_context.build_wheels()?; + let wheels = build_context.build_wheels()?; + assert!(!wheels.is_empty()); } #[cfg(feature = "upload")] Opt::Publish {