Skip to content

Commit 3468d95

Browse files
committed
Add 3.14 to validation
1 parent 7b15c04 commit 3468d95

File tree

1 file changed

+54
-14
lines changed

1 file changed

+54
-14
lines changed

src/validation.rs

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
129129
"python312.dll",
130130
"python313.dll",
131131
"python313t.dll",
132+
"python314.dll",
133+
"python314t.dll",
132134
"sqlite3.dll",
133135
"tcl86t.dll",
134136
"tk86t.dll",
@@ -304,6 +306,26 @@ static DARWIN_ALLOWED_DYLIBS: Lazy<Vec<MachOAllowedDylib>> = Lazy::new(|| {
304306
max_compatibility_version: "3.13.0".try_into().unwrap(),
305307
required: false,
306308
},
309+
MachOAllowedDylib {
310+
name: "@executable_path/../lib/libpython3.14.dylib".to_string(),
311+
max_compatibility_version: "3.14.0".try_into().unwrap(),
312+
required: false,
313+
},
314+
MachOAllowedDylib {
315+
name: "@executable_path/../lib/libpython3.14d.dylib".to_string(),
316+
max_compatibility_version: "3.14.0".try_into().unwrap(),
317+
required: false,
318+
},
319+
MachOAllowedDylib {
320+
name: "@executable_path/../lib/libpython3.14t.dylib".to_string(),
321+
max_compatibility_version: "3.14.0".try_into().unwrap(),
322+
required: false,
323+
},
324+
MachOAllowedDylib {
325+
name: "@executable_path/../lib/libpython3.14td.dylib".to_string(),
326+
max_compatibility_version: "3.14.0".try_into().unwrap(),
327+
required: false,
328+
},
307329
MachOAllowedDylib {
308330
name: "/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit".to_string(),
309331
max_compatibility_version: "45.0.0".try_into().unwrap(),
@@ -581,7 +603,6 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
581603
"_ast",
582604
"_asyncio",
583605
"_bisect",
584-
"_blake2",
585606
"_bz2",
586607
"_codecs",
587608
"_codecs_cn",
@@ -667,6 +688,7 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
667688

668689
const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
669690
"audioop",
691+
"_blake2",
670692
"_peg_parser",
671693
"_sha256",
672694
"_sha512",
@@ -677,6 +699,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
677699

678700
const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[
679701
"audioop",
702+
"_blake2",
680703
"_sha256",
681704
"_sha512",
682705
"_xxsubinterpreters",
@@ -685,6 +708,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[
685708

686709
const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[
687710
"audioop",
711+
"_blake2",
688712
"_sha256",
689713
"_sha512",
690714
"_tokenize",
@@ -695,6 +719,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[
695719

696720
const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[
697721
"audioop",
722+
"_blake2",
698723
"_sha2",
699724
"_tokenize",
700725
"_typing",
@@ -704,6 +729,18 @@ const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[
704729
];
705730

706731
const GLOBAL_EXTENSIONS_PYTHON_3_13: &[&str] = &[
732+
"_blake2",
733+
"_interpchannels",
734+
"_interpqueues",
735+
"_interpreters",
736+
"_sha2",
737+
"_sysconfig",
738+
"_tokenize",
739+
"_typing",
740+
"_zoneinfo",
741+
];
742+
743+
const GLOBAL_EXTENSIONS_PYTHON_3_14: &[&str] = &[
707744
"_interpchannels",
708745
"_interpqueues",
709746
"_interpreters",
@@ -717,7 +754,6 @@ const GLOBAL_EXTENSIONS_PYTHON_3_13: &[&str] = &[
717754
const GLOBAL_EXTENSIONS_MACOS: &[&str] = &["_scproxy"];
718755

719756
const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[
720-
"_crypt",
721757
"_ctypes_test",
722758
"_curses",
723759
"_curses_panel",
@@ -735,6 +771,8 @@ const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[
735771
"termios",
736772
];
737773

774+
const GLOBAL_EXTENSIONS_POSIX_PRE_3_13: &[&str] = &["_crypt"];
775+
738776
const GLOBAL_EXTENSIONS_LINUX_PRE_3_13: &[&str] = &["spwd"];
739777

740778
const GLOBAL_EXTENSIONS_WINDOWS: &[&str] = &[
@@ -1070,7 +1108,6 @@ fn parse_version_nibbles(v: u32) -> semver::Version {
10701108
fn validate_macho<Mach: MachHeader<Endian = Endianness>>(
10711109
context: &mut ValidationContext,
10721110
target_triple: &str,
1073-
python_major_minor: &str,
10741111
advertised_target_version: &str,
10751112
advertised_sdk_version: &str,
10761113
path: &Path,
@@ -1365,7 +1402,6 @@ fn validate_possible_object_file(
13651402
validate_macho(
13661403
&mut context,
13671404
triple,
1368-
python_major_minor,
13691405
json.apple_sdk_deployment_target
13701406
.as_ref()
13711407
.expect("apple_sdk_deployment_target should be set"),
@@ -1383,7 +1419,6 @@ fn validate_possible_object_file(
13831419
validate_macho(
13841420
&mut context,
13851421
triple,
1386-
python_major_minor,
13871422
json.apple_sdk_deployment_target
13881423
.as_ref()
13891424
.expect("apple_sdk_deployment_target should be set"),
@@ -1454,16 +1489,21 @@ fn validate_extension_modules(
14541489
"3.13" => {
14551490
wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_13);
14561491
}
1492+
"3.14" => {
1493+
wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_14);
1494+
}
14571495
_ => {
14581496
panic!("unhandled Python version: {}", python_major_minor);
14591497
}
14601498
}
14611499

14621500
if is_macos {
14631501
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
1464-
if python_major_minor == "3.13" {
1465-
wanted.remove("_crypt");
1502+
1503+
if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") {
1504+
wanted.extend(GLOBAL_EXTENSIONS_POSIX_PRE_3_13);
14661505
}
1506+
14671507
wanted.extend(GLOBAL_EXTENSIONS_MACOS);
14681508
}
14691509

@@ -1483,11 +1523,11 @@ fn validate_extension_modules(
14831523

14841524
if is_linux {
14851525
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
1486-
// TODO: If there are more differences for `GLOBAL_EXTENSIONS_POSIX` in future Python
1487-
// versions, we should move the `_crypt` special-case into a constant
1488-
if python_major_minor == "3.13" {
1489-
wanted.remove("_crypt");
1526+
1527+
if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") {
1528+
wanted.extend(GLOBAL_EXTENSIONS_POSIX_PRE_3_13);
14901529
}
1530+
14911531
if matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") {
14921532
wanted.extend(GLOBAL_EXTENSIONS_LINUX_PRE_3_13);
14931533
}
@@ -1497,7 +1537,7 @@ fn validate_extension_modules(
14971537
}
14981538
}
14991539

1500-
if (is_linux || is_macos) {
1540+
if is_linux || is_macos {
15011541
wanted.extend([
15021542
"_testbuffer",
15031543
"_testimportmultiple",
@@ -1506,11 +1546,11 @@ fn validate_extension_modules(
15061546
]);
15071547
}
15081548

1509-
if (is_linux || is_macos) && python_major_minor == "3.13" {
1549+
if (is_linux || is_macos) && matches!(python_major_minor, "3.13" | "3.14") {
15101550
wanted.extend(["_suggestions", "_testexternalinspection"]);
15111551
}
15121552

1513-
if (is_linux || is_macos) && matches!(python_major_minor, "3.12" | "3.13") {
1553+
if (is_linux || is_macos) && matches!(python_major_minor, "3.12" | "3.13" | "3.14") {
15141554
wanted.insert("_testsinglephase");
15151555
}
15161556

0 commit comments

Comments
 (0)