Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: fix implib file name for python3.13t #84

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ impl ImportLibraryGenerator {
///
/// Returns the full import library file path under `out_dir`.
fn implib_file_path(&self, out_dir: &Path, libext: &str) -> PathBuf {
let abiflags = self.abiflags.as_deref().unwrap_or_default();
let libname = match self.version {
Some((major, minor)) => {
format!("python{}{}{}", major, minor, libext)
format!("python{}{}{}{}", major, minor, abiflags, libext)
}
None => format!("python3{}", libext),
};
Expand Down Expand Up @@ -663,11 +664,13 @@ mod tests {

// Free-threaded CPython v3.13+
for minor in 13..=13 {
ImportLibraryGenerator::new("aarch64", "msvc")
.version(Some((3, minor)))
.abiflags(Some("t"))
.generate(&dir)
.unwrap();
let mut generator = ImportLibraryGenerator::new("aarch64", "msvc");
generator.version(Some((3, minor))).abiflags(Some("t"));
let implib_file_path = generator.implib_file_path(&dir, IMPLIB_EXT_MSVC);
let implib_file_stem = implib_file_path.file_stem().unwrap().to_str().unwrap();
assert!(implib_file_stem.ends_with("t"));

generator.generate(&dir).unwrap();
}

// PyPy
Expand Down
Loading