From b4cd74a291d61b97788a7c0e8c242477c9b394c5 Mon Sep 17 00:00:00 2001 From: Sergey Kvachonok Date: Sat, 30 Nov 2024 12:06:29 +0300 Subject: [PATCH 1/3] test: Run the full set of tests for Windows ARM64 --- src/lib.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 56a18ed..d86f42a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -649,6 +649,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(); + } } } From b8656ccac1b13b3256681561b387fe9f4a11346a Mon Sep 17 00:00:00 2001 From: Sergey Kvachonok Date: Sat, 30 Nov 2024 12:32:30 +0300 Subject: [PATCH 2/3] chore: Fix some pedantic Clippy warnings --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d86f42a..db81eb1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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}; @@ -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(), @@ -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")), @@ -500,7 +501,7 @@ fn get_mingw_dlltool(arch: &str) -> Result { } } -/// 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. From 97410813986308dcfb93c6611547a9c124682a96 Mon Sep 17 00:00:00 2001 From: Sergey Kvachonok Date: Sat, 30 Nov 2024 12:33:22 +0300 Subject: [PATCH 3/3] ci: Run Clippy for all targets instead of just tests --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fff4f7e..8820493 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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