Skip to content

Commit a02d8fb

Browse files
kpflemingzanieb
authored andcommitted
Update extensions validator for 3.13.
1 parent 6a0ce48 commit a02d8fb

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

src/validation.rs

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
648648
"_weakref",
649649
"array",
650650
"atexit",
651-
"audioop",
652651
"binascii",
653652
"builtins",
654653
"cmath",
@@ -675,13 +674,15 @@ const GLOBAL_EXTENSIONS: &[&str] = &[
675674
// _testsinglephase added in 3.12.
676675
// _sha256 and _sha512 merged into _sha2 in 3.12.
677676
// _xxinterpchannels added in 3.12.
677+
// audioop removed in 3.13.
678678

679679
// We didn't build ctypes_test until 3.9.
680680
// We didn't build some test extensions until 3.9.
681681

682-
const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["_sha256", "_sha512", "parser"];
682+
const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["audioop", "_sha256", "_sha512", "parser"];
683683

684684
const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
685+
"audioop",
685686
"_peg_parser",
686687
"_sha256",
687688
"_sha512",
@@ -692,6 +693,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[
692693
];
693694

694695
const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[
696+
"audioop",
695697
"_sha256",
696698
"_sha512",
697699
"_uuid",
@@ -700,6 +702,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[
700702
];
701703

702704
const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[
705+
"audioop",
703706
"_sha256",
704707
"_sha512",
705708
"_tokenize",
@@ -710,6 +713,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[
710713
];
711714

712715
const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[
716+
"audioop",
713717
"_sha2",
714718
"_tokenize",
715719
"_typing",
@@ -718,13 +722,16 @@ const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[
718722
"_zoneinfo",
719723
];
720724

721-
// FIXME: ensure that this list is correct for 3.13
722725
const GLOBAL_EXTENSIONS_PYTHON_3_13: &[&str] = &[
726+
"_interpchannels",
727+
"_interpqueues",
728+
"_interpreters",
723729
"_sha2",
730+
"_suggestions",
731+
"_sysconfig",
732+
"_testexternalinspection",
724733
"_tokenize",
725734
"_typing",
726-
"_xxinterpchannels",
727-
"_xxsubinterpreters",
728735
"_zoneinfo",
729736
];
730737

@@ -749,7 +756,7 @@ const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[
749756
"termios",
750757
];
751758

752-
const GLOBAL_EXTENSIONS_LINUX: &[&str] = &["spwd"];
759+
const GLOBAL_EXTENSIONS_LINUX_PRE_3_13: &[&str] = &["spwd"];
753760

754761
const GLOBAL_EXTENSIONS_WINDOWS: &[&str] = &[
755762
"_msi",
@@ -1479,6 +1486,9 @@ fn validate_extension_modules(
14791486

14801487
if is_macos {
14811488
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
1489+
if python_major_minor == "3.13" {
1490+
wanted.remove("_crypt");
1491+
}
14821492
wanted.extend(GLOBAL_EXTENSIONS_MACOS);
14831493
}
14841494

@@ -1494,14 +1504,25 @@ fn validate_extension_modules(
14941504

14951505
if is_linux {
14961506
wanted.extend(GLOBAL_EXTENSIONS_POSIX);
1497-
wanted.extend(GLOBAL_EXTENSIONS_LINUX);
1507+
if python_major_minor == "3.13" {
1508+
wanted.remove("_crypt");
1509+
}
1510+
if matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") {
1511+
wanted.extend(GLOBAL_EXTENSIONS_LINUX_PRE_3_13);
1512+
}
14981513

1499-
if !is_linux_musl {
1514+
if !is_linux_musl && matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12")
1515+
{
15001516
wanted.insert("ossaudiodev");
15011517
}
15021518
}
15031519

1504-
if (is_linux || is_macos) && matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12" | "3.13") {
1520+
if (is_linux || is_macos)
1521+
&& matches!(
1522+
python_major_minor,
1523+
"3.9" | "3.10" | "3.11" | "3.12" | "3.13"
1524+
)
1525+
{
15051526
wanted.extend([
15061527
"_testbuffer",
15071528
"_testimportmultiple",

0 commit comments

Comments
 (0)