@@ -345,6 +345,7 @@ def hack_props(
345
345
td : pathlib .Path ,
346
346
pcbuild_path : pathlib .Path ,
347
347
arch : str ,
348
+ python_version : str ,
348
349
):
349
350
# TODO can we pass props into msbuild.exe?
350
351
@@ -355,9 +356,14 @@ def hack_props(
355
356
sqlite_version = DOWNLOADS ["sqlite" ]["version" ]
356
357
xz_version = DOWNLOADS ["xz" ]["version" ]
357
358
zlib_version = DOWNLOADS ["zlib" ]["version" ]
358
- tcltk_commit = DOWNLOADS [ "tk-windows-bin-8612" ][ "git_commit" ]
359
+
359
360
mpdecimal_version = DOWNLOADS ["mpdecimal" ]["version" ]
360
361
362
+ if meets_python_minimum_version (python_version , "3.14" ):
363
+ tcltk_commit = DOWNLOADS ["tk-windows-bin" ]["git_commit" ]
364
+ else :
365
+ tcltk_commit = DOWNLOADS ["tk-windows-bin-8612" ]["git_commit" ]
366
+
361
367
sqlite_path = td / ("sqlite-autoconf-%s" % sqlite_version )
362
368
bzip2_path = td / ("bzip2-%s" % bzip2_version )
363
369
libffi_path = td / "libffi"
@@ -487,6 +493,7 @@ def hack_project_files(
487
493
td ,
488
494
pcbuild_path ,
489
495
build_directory ,
496
+ python_version ,
490
497
)
491
498
492
499
# Our SQLite directory is named weirdly. This throws off version detection
@@ -1128,6 +1135,10 @@ def find_additional_dependencies(project: pathlib.Path):
1128
1135
if name == "openssl" :
1129
1136
name = openssl_entry
1130
1137
1138
+ # On 3.14+, we use the latest tcl/tk version
1139
+ if ext == "_tkinter" and python_majmin == "314" :
1140
+ name = name .replace ("-8612" , "" )
1141
+
1131
1142
download_entry = DOWNLOADS [name ]
1132
1143
1133
1144
# This will raise if no license metadata defined. This is
@@ -1197,9 +1208,6 @@ def build_cpython(
1197
1208
1198
1209
bzip2_archive = download_entry ("bzip2" , BUILD )
1199
1210
sqlite_archive = download_entry ("sqlite" , BUILD )
1200
- tk_bin_archive = download_entry (
1201
- "tk-windows-bin-8612" , BUILD , local_name = "tk-windows-bin.tar.gz"
1202
- )
1203
1211
xz_archive = download_entry ("xz" , BUILD )
1204
1212
zlib_archive = download_entry ("zlib" , BUILD )
1205
1213
@@ -1211,6 +1219,17 @@ def build_cpython(
1211
1219
setuptools_wheel = download_entry ("setuptools" , BUILD )
1212
1220
pip_wheel = download_entry ("pip" , BUILD )
1213
1221
1222
+ # On CPython 3.14+, we use the latest tcl/tk version which has additional runtime
1223
+ # dependencies, so we are conservative and use the old version elsewhere.
1224
+ if meets_python_minimum_version (python_version , "3.14" ):
1225
+ tk_bin_archive = download_entry (
1226
+ "tk-windows-bin" , BUILD , local_name = "tk-windows-bin.tar.gz"
1227
+ )
1228
+ else :
1229
+ tk_bin_archive = download_entry (
1230
+ "tk-windows-bin-8612" , BUILD , local_name = "tk-windows-bin.tar.gz"
1231
+ )
1232
+
1214
1233
# CPython 3.13+ no longer uses a bundled `mpdecimal` version so we build it
1215
1234
if meets_python_minimum_version (python_version , "3.13" ):
1216
1235
mpdecimal_archive = download_entry ("mpdecimal" , BUILD )
0 commit comments