Skip to content

Commit 6abaf04

Browse files
committed
feat(toolchain): Add support for Python 3.13.1.
This makes 3.13.1 the default for 3.13. Tests have been slightly altered to use the version 3.13.99, which aim at making an unreleased version easier to spot.
1 parent b5ed3e4 commit 6abaf04

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

python/versions.bzl

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,43 @@ TOOL_VERSIONS = {
603603
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
604604
},
605605
},
606+
"3.13.1": {
607+
"url": "20241205/cpython-{python_version}+20241205-{platform}-{build}.{ext}",
608+
"sha256": {
609+
"aarch64-apple-darwin": "88b88b609129c12f4b3841845aca13230f61e97ba97bd0fb28ee64b0e442a34f",
610+
"aarch64-unknown-linux-gnu": "fdfa86c2746d2ae700042c461846e6c37f70c249925b58de8cd02eb8d1423d4e",
611+
"ppc64le-unknown-linux-gnu": "27b20b3237c55430ca1304e687d021f88373f906249f9cd272c5ff2803d5e5c3",
612+
"s390x-unknown-linux-gnu": "7d0187e20cb5e36c689eec27e4d3de56d8b7f1c50dc5523550fc47377801521f",
613+
"x86_64-apple-darwin": "47eef6efb8664e2d1d23a7cdaf56262d784f8ace48f3bfca1b183e95a49888d6",
614+
"x86_64-pc-windows-msvc": "f51f0493a5f979ff0b8d8c598a8d74f2a4d86a190c2729c85e0af65c36a9cbbe",
615+
"x86_64-unknown-linux-gnu": "242b2727df6c1e00de6a9f0f0dcb4562e168d27f428c785b0eb41a6aeb34d69a",
616+
"x86_64-unknown-linux-musl": "76b30c6373b9c0aa2ba610e07da02f384aa210ac79643da38c66d3e6171c6ef5",
617+
"aarch64-apple-darwin-freethreaded": "08f05618bdcf8064a7960b25d9ba92155447c9b08e0cf2f46a981e4c6a1bb5a5",
618+
"aarch64-unknown-linux-gnu-freethreaded": "9f2fcb809f9ba6c7c014a8803073a88786701a98971135bce684355062e4bb35",
619+
"ppc64le-unknown-linux-gnu-freethreaded": "15ceea78dff78ca8ccaac8d9c54b808af30daaa126f1f561e920a6896e098634",
620+
"s390x-unknown-linux-gnu-freethreaded": "ed3c6118d1d12603309c930e93421ac7a30a69045ffd43006f63ecf71d72c317",
621+
"x86_64-apple-darwin-freethreaded": "dc780fecd215d2cc9e573abf1e13a175fcfa8f6efd100ef888494a248a16cda8",
622+
"x86_64-pc-windows-msvc-freethreaded": "7537b2ab361c0eabc0eabfca9ffd9862d7f5f6576eda13b97e98aceb5eea4fd3",
623+
"x86_64-unknown-linux-gnu-freethreaded": "9ec1b81213f849d91f5ebe6a16196e85cd6ff7c05ca823ce0ab7ba5b0e9fee84",
624+
},
625+
"strip_prefix": {
626+
"aarch64-apple-darwin": "python",
627+
"aarch64-unknown-linux-gnu": "python",
628+
"ppc64le-unknown-linux-gnu": "python",
629+
"s390x-unknown-linux-gnu": "python",
630+
"x86_64-apple-darwin": "python",
631+
"x86_64-pc-windows-msvc": "python",
632+
"x86_64-unknown-linux-gnu": "python",
633+
"x86_64-unknown-linux-musl": "python",
634+
"aarch64-apple-darwin-freethreaded": "python/install",
635+
"aarch64-unknown-linux-gnu-freethreaded": "python/install",
636+
"ppc64le-unknown-linux-gnu-freethreaded": "python/install",
637+
"s390x-unknown-linux-gnu-freethreaded": "python/install",
638+
"x86_64-apple-darwin-freethreaded": "python/install",
639+
"x86_64-pc-windows-msvc-freethreaded": "python/install",
640+
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
641+
},
642+
},
606643
}
607644

608645
# buildifier: disable=unsorted-dict-items
@@ -612,7 +649,7 @@ MINOR_MAPPING = {
612649
"3.10": "3.10.15",
613650
"3.11": "3.11.10",
614651
"3.12": "3.12.7",
615-
"3.13": "3.13.0",
652+
"3.13": "3.13.1",
616653
}
617654

618655
def _generate_platforms():

tests/python/python_tests.bzl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,17 +413,17 @@ def _test_add_new_version(env):
413413
strip_prefix = "python",
414414
platform = "aarch64-unknown-linux-gnu",
415415
coverage_tool = "specific_cov_tool",
416-
python_version = "3.13.1",
416+
python_version = "3.13.99",
417417
patch_strip = 2,
418418
patches = ["specific-patch.txt"],
419419
),
420420
],
421421
override = [
422422
_override(
423423
base_url = "",
424-
available_python_versions = ["3.12.4", "3.13.0", "3.13.1"],
424+
available_python_versions = ["3.12.4", "3.13.0", "3.13.1", "3.13.99"],
425425
minor_mapping = {
426-
"3.13": "3.13.0",
426+
"3.13": "3.13.99",
427427
},
428428
),
429429
],
@@ -436,13 +436,14 @@ def _test_add_new_version(env):
436436
"3.12.4",
437437
"3.13.0",
438438
"3.13.1",
439+
"3.13.99",
439440
])
440441
env.expect.that_dict(py.config.default["tool_versions"]["3.13.0"]).contains_exactly({
441442
"sha256": {"aarch64-unknown-linux-gnu": "deadbeef"},
442443
"strip_prefix": {"aarch64-unknown-linux-gnu": "prefix"},
443444
"url": {"aarch64-unknown-linux-gnu": ["example.org"]},
444445
})
445-
env.expect.that_dict(py.config.default["tool_versions"]["3.13.1"]).contains_exactly({
446+
env.expect.that_dict(py.config.default["tool_versions"]["3.13.99"]).contains_exactly({
446447
"coverage_tool": {"aarch64-unknown-linux-gnu": "specific_cov_tool"},
447448
"patch_strip": {"aarch64-unknown-linux-gnu": 2},
448449
"patches": {"aarch64-unknown-linux-gnu": ["specific-patch.txt"]},
@@ -452,7 +453,7 @@ def _test_add_new_version(env):
452453
})
453454
env.expect.that_dict(py.config.minor_mapping).contains_exactly({
454455
"3.12": "3.12.4", # The `minor_mapping` will be overriden only for the missing keys
455-
"3.13": "3.13.0",
456+
"3.13": "3.13.99",
456457
})
457458
env.expect.that_collection(py.toolchains).contains_exactly([
458459
struct(
@@ -484,13 +485,13 @@ def _test_register_all_versions(env):
484485
sha256 = "deadb00f",
485486
urls = ["something.org"],
486487
platform = "aarch64-unknown-linux-gnu",
487-
python_version = "3.13.1",
488+
python_version = "3.13.99",
488489
),
489490
],
490491
override = [
491492
_override(
492493
base_url = "",
493-
available_python_versions = ["3.12.4", "3.13.0", "3.13.1"],
494+
available_python_versions = ["3.12.4", "3.13.0", "3.13.1", "3.13.99"],
494495
register_all_versions = True,
495496
),
496497
],
@@ -503,11 +504,12 @@ def _test_register_all_versions(env):
503504
"3.12.4",
504505
"3.13.0",
505506
"3.13.1",
507+
"3.13.99",
506508
])
507509
env.expect.that_dict(py.config.minor_mapping).contains_exactly({
508510
# The mapping is calculated automatically
509511
"3.12": "3.12.4",
510-
"3.13": "3.13.1",
512+
"3.13": "3.13.99",
511513
})
512514
env.expect.that_collection(py.toolchains).contains_exactly([
513515
struct(
@@ -521,6 +523,7 @@ def _test_register_all_versions(env):
521523
"python_3_13": "3.13",
522524
"python_3_13_0": "3.13.0",
523525
"python_3_13_1": "3.13.1",
526+
"python_3_13_99": "3.13.99",
524527
}.items()
525528
])
526529

0 commit comments

Comments
 (0)