Skip to content

Commit ac5aa86

Browse files
authored
Merge pull request #83 from PyO3/test-windows-arm64
Run the full set of tests for Windows ARM64
2 parents d13167d + 9741081 commit ac5aa86

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
steps:
6060
- uses: actions/checkout@v4
6161
- name: Run cargo clippy
62-
run: cargo clippy --tests -- --deny warnings
62+
run: cargo clippy --all-targets -- --deny warnings

src/lib.rs

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
9898
#![deny(missing_docs)]
9999
#![allow(clippy::needless_doctest_main)]
100+
#![allow(clippy::uninlined_format_args)]
100101

101102
use std::env;
102103
use std::fs::{create_dir_all, write};
@@ -200,6 +201,7 @@ impl ImportLibraryGenerator {
200201
///
201202
/// The compile target environment ABI name (as in `CARGO_CFG_TARGET_ENV`)
202203
/// is passed in `env`.
204+
#[must_use]
203205
pub fn new(arch: &str, env: &str) -> Self {
204206
ImportLibraryGenerator {
205207
arch: arch.to_string(),
@@ -293,8 +295,7 @@ impl ImportLibraryGenerator {
293295
_ => return Err(Error::new(ErrorKind::Other, "Unsupported Python version")),
294296
},
295297
PythonImplementation::PyPy => match self.version {
296-
Some((3, 7)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
297-
Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
298+
Some((3, 7)) | Some((3, 8)) => ("libpypy3-c.def", include_str!("libpypy3-c.def")),
298299
Some((3, 9)) => ("libpypy3.9-c.def", include_str!("libpypy3.9-c.def")),
299300
Some((3, 10)) => ("libpypy3.10-c.def", include_str!("libpypy3.10-c.def")),
300301
_ => return Err(Error::new(ErrorKind::Other, "Unsupported PyPy version")),
@@ -500,7 +501,7 @@ fn get_mingw_dlltool(arch: &str) -> Result<Command> {
500501
}
501502
}
502503

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

652-
generate_implib_for_target(&dir, "aarch64", "msvc").unwrap();
653+
ImportLibraryGenerator::new("aarch64", "msvc")
654+
.generate(&dir)
655+
.unwrap();
656+
657+
for minor in 7..=13 {
658+
ImportLibraryGenerator::new("aarch64", "msvc")
659+
.version(Some((3, minor)))
660+
.generate(&dir)
661+
.unwrap();
662+
}
663+
664+
// Free-threaded CPython v3.13+
665+
for minor in 13..=13 {
666+
ImportLibraryGenerator::new("aarch64", "msvc")
667+
.version(Some((3, minor)))
668+
.abiflags(Some("t"))
669+
.generate(&dir)
670+
.unwrap();
671+
}
672+
673+
// PyPy
674+
for minor in 7..=10 {
675+
ImportLibraryGenerator::new("aarch64", "msvc")
676+
.version(Some((3, minor)))
677+
.implementation(PythonImplementation::PyPy)
678+
.generate(&dir)
679+
.unwrap();
680+
}
653681
}
654682
}

0 commit comments

Comments
 (0)