Skip to content

Commit 970f028

Browse files
kpflemingzanieb
authored andcommitted
Update extensions validator for 3.13.
1 parent 0bad18f commit 970f028

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",
@@ -1478,6 +1485,9 @@ fn validate_extension_modules(
14781485

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

@@ -1493,14 +1503,25 @@ fn validate_extension_modules(
14931503

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

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

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

0 commit comments

Comments
 (0)