Skip to content

Commit

Permalink
Merge pull request #83 from PyO3/test-windows-arm64
Browse files Browse the repository at this point in the history
Run the full set of tests for Windows ARM64
  • Loading branch information
ravenexp authored Nov 30, 2024
2 parents d13167d + 9741081 commit ac5aa86
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run cargo clippy
run: cargo clippy --tests -- --deny warnings
run: cargo clippy --all-targets -- --deny warnings
36 changes: 32 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#![deny(missing_docs)]
#![allow(clippy::needless_doctest_main)]
#![allow(clippy::uninlined_format_args)]

use std::env;
use std::fs::{create_dir_all, write};
Expand Down Expand Up @@ -200,6 +201,7 @@ impl ImportLibraryGenerator {
///
/// The compile target environment ABI name (as in `CARGO_CFG_TARGET_ENV`)
/// is passed in `env`.
#[must_use]
pub fn new(arch: &str, env: &str) -> Self {
ImportLibraryGenerator {
arch: arch.to_string(),
Expand Down Expand Up @@ -293,8 +295,7 @@ impl ImportLibraryGenerator {
_ => return Err(Error::new(ErrorKind::Other, "Unsupported Python version")),
},
PythonImplementation::PyPy => match self.version {
Some((3, 7)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
Some((3, 7)) | Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
Some((3, 9)) => ("libpypy3.9-c.def", include_str!("libpypy3.9-c.def")),
Some((3, 10)) => ("libpypy3.10-c.def", include_str!("libpypy3.10-c.def")),
_ => return Err(Error::new(ErrorKind::Other, "Unsupported PyPy version")),
Expand Down Expand Up @@ -500,7 +501,7 @@ fn get_mingw_dlltool(arch: &str) -> Result<Command> {
}
}

/// Finds the `zig` executable (when built by ``maturin --zig`).
/// Finds the `zig` executable (when built by `maturin --zig`).
///
/// Examines the `ZIG_COMMAND` environment variable
/// to find out if `zig cc` is being used as the linker.
Expand Down Expand Up @@ -649,6 +650,33 @@ mod tests {
dir.push("aarch64-pc-windows-msvc");
dir.push("python3-dll");

generate_implib_for_target(&dir, "aarch64", "msvc").unwrap();
ImportLibraryGenerator::new("aarch64", "msvc")
.generate(&dir)
.unwrap();

for minor in 7..=13 {
ImportLibraryGenerator::new("aarch64", "msvc")
.version(Some((3, minor)))
.generate(&dir)
.unwrap();
}

// Free-threaded CPython v3.13+
for minor in 13..=13 {
ImportLibraryGenerator::new("aarch64", "msvc")
.version(Some((3, minor)))
.abiflags(Some("t"))
.generate(&dir)
.unwrap();
}

// PyPy
for minor in 7..=10 {
ImportLibraryGenerator::new("aarch64", "msvc")
.version(Some((3, minor)))
.implementation(PythonImplementation::PyPy)
.generate(&dir)
.unwrap();
}
}
}

0 comments on commit ac5aa86

Please sign in to comment.