@@ -345,6 +345,7 @@ def hack_props(
345345 td : pathlib .Path ,
346346 pcbuild_path : pathlib .Path ,
347347 arch : str ,
348+ python_version : str ,
348349):
349350 # TODO can we pass props into msbuild.exe?
350351
@@ -355,9 +356,14 @@ def hack_props(
355356 sqlite_version = DOWNLOADS ["sqlite" ]["version" ]
356357 xz_version = DOWNLOADS ["xz" ]["version" ]
357358 zlib_version = DOWNLOADS ["zlib" ]["version" ]
358- tcltk_commit = DOWNLOADS [ "tk-windows-bin-8612" ][ "git_commit" ]
359+
359360 mpdecimal_version = DOWNLOADS ["mpdecimal" ]["version" ]
360361
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+
361367 sqlite_path = td / ("sqlite-autoconf-%s" % sqlite_version )
362368 bzip2_path = td / ("bzip2-%s" % bzip2_version )
363369 libffi_path = td / "libffi"
@@ -487,6 +493,7 @@ def hack_project_files(
487493 td ,
488494 pcbuild_path ,
489495 build_directory ,
496+ python_version ,
490497 )
491498
492499 # Our SQLite directory is named weirdly. This throws off version detection
@@ -1128,6 +1135,10 @@ def find_additional_dependencies(project: pathlib.Path):
11281135 if name == "openssl" :
11291136 name = openssl_entry
11301137
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+
11311142 download_entry = DOWNLOADS [name ]
11321143
11331144 # This will raise if no license metadata defined. This is
@@ -1197,9 +1208,6 @@ def build_cpython(
11971208
11981209 bzip2_archive = download_entry ("bzip2" , BUILD )
11991210 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- )
12031211 xz_archive = download_entry ("xz" , BUILD )
12041212 zlib_archive = download_entry ("zlib" , BUILD )
12051213
@@ -1211,6 +1219,17 @@ def build_cpython(
12111219 setuptools_wheel = download_entry ("setuptools" , BUILD )
12121220 pip_wheel = download_entry ("pip" , BUILD )
12131221
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+
12141233 # CPython 3.13+ no longer uses a bundled `mpdecimal` version so we build it
12151234 if meets_python_minimum_version (python_version , "3.13" ):
12161235 mpdecimal_archive = download_entry ("mpdecimal" , BUILD )
0 commit comments