Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ END_UNRELEASED_TEMPLATE
vendoring the `requirements.bzl` file, please re-vendor so that downstream is unaffected
when the APIs get removed. If you need to customize the way the dependencies get
evaluated, see [our docs](/pypi/download.html#customizing-requires-dist-resolution) on customizing `Requires-Dist` resolution.
* (toolchains) Added Python version 3.14.0.
* (toolchains) Added Python versions 3.14.0, 3.13.8, 3.12.12, 3.11.14, 3.10.19, and 3.9.24
from the [20251010] release.

[20251010]: https://github.com/astral-sh/python-build-standalone/releases/tag/20251010

{#v0-0-0-fixed}
### Fixed
Expand All @@ -105,6 +108,8 @@ END_UNRELEASED_TEMPLATE
variants. Setting {obj}`--py_linux_libc=musl` and `--py_freethreaded=yes` now
activate them, respectively.
([#3262](https://github.com/bazel-contrib/rules_python/issues/3262)).
* (rules) {obj}`py_console_script_binary` is now compatible with symbolic macros
([#3195](https://github.com/bazel-contrib/rules_python/pull/3195)).

{#v0-0-0-added}
### Added
Expand Down
7 changes: 5 additions & 2 deletions python/private/py_console_script_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def py_console_script_binary(
script = None,
binary_rule = py_binary,
shebang = "",
main = None,
**kwargs):
"""Generate a py_binary for a console_script entry_point.

Expand All @@ -66,20 +67,22 @@ def py_console_script_binary(
package as the `pkg` Label.
script: {type}`str`, The console script name that the py_binary is going to be
generated for. Defaults to the normalized name attribute.
main: {type}`str`, the python file to be generated, defaults to `<name>_entry_point.py` to
be compatible with symbolic macros.
binary_rule: {type}`callable`, The rule/macro to use to instantiate
the target. It's expected to behave like {obj}`py_binary`.
Defaults to {obj}`py_binary`.
shebang: {type}`str`, The shebang to use for the entry point python file.
Defaults to empty string.
**kwargs: Extra parameters forwarded to `binary_rule`.
"""
main = "rules_python_entry_point_{}.py".format(name)
main = main or name + "_entry_point.py"

if kwargs.pop("srcs", None):
fail("passing 'srcs' attribute to py_console_script_binary is unsupported")

py_console_script_gen(
name = "_{}_gen".format(name),
name = name + "_gen__",
entry_points_txt = entry_points_txt or _dist_info(pkg),
out = main,
console_script = script,
Expand Down
157 changes: 132 additions & 25 deletions python/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,21 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
},
"3.9.24": {
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.tar.gz",
"sha256": {
"aarch64-apple-darwin": "03af9b83cdda23c8b82537f720cc37ddc0d5635b282c8ea8326382f3f0221141",
"aarch64-unknown-linux-gnu": "e1aff69545ab15dc22ffe9f28c8d162af0e4be9a9cf57c0a50a0916508964ccb",
"ppc64le-unknown-linux-gnu": "c70891539abf23746dcfb32043bf91c6f2dfcd97106ff1ed75b744f9e00b5551",
"riscv64-unknown-linux-gnu": "ce180e819d992fda0c523fba88db79b9d9bc9b12a52d548479d84c7b86d5bcda",
"s390x-unknown-linux-gnu": "9a830f9b8fa62962e22f5aa105f12fde9d40d7969d701e9600d580e4f0cb7ac6",
"x86_64-apple-darwin": "aabb592ba83217c092744f53c14da10b6e3dab6f96e0eefd346e6ac0c0723dd2",
"x86_64-pc-windows-msvc": "28fd634e9e20f2a94e29e8c8c8a5384a2882091e9d0af981e7e99cc156be1648",
"x86_64-unknown-linux-gnu": "fe63b51f543011e0582a98259d98fbc0033bc2009398404446f350fe9e531aa3",
"x86_64-unknown-linux-musl": "844db0ca41ccf897f58fbefd8f5df7ef18ea374788e6ce4cb87989f997c3f21a",
},
"strip_prefix": "python",
},
"3.10.2": {
"url": "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz",
"sha256": {
Expand Down Expand Up @@ -354,6 +369,21 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
},
"3.10.19": {
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.tar.gz",
"sha256": {
"aarch64-apple-darwin": "4918c7b7dd9bdeb81b2a30b5305d85e04c6f322ed715b598bf7afbfd03b39f23",
"aarch64-unknown-linux-gnu": "356fce3bed7d4c416c552d054cf647886b3825b285a06b4b8782440dccc5f5c1",
"ppc64le-unknown-linux-gnu": "b129fcc438aee69429c1d90dd251579393eaf690d5cf9f327a41c79448ff062f",
"riscv64-unknown-linux-gnu": "118e4444dc8a98d7f52cca86b1f9a4636c45eba3d759689bd86f68c579fe03d0",
"s390x-unknown-linux-gnu": "d62e65e77199f35d54cae383977ccbf30fca1ba683f96e6ffc04a17d5d31e959",
"x86_64-apple-darwin": "90665ea564d409de944e7e985e9ddeecc1d61980616983d26b06bc721cfa8469",
"x86_64-pc-windows-msvc": "1e56b702e080723a76d92ba04d0f8b6e49986113b575c7026797d1de53a5b89b",
"x86_64-unknown-linux-gnu": "4f1c6812961ed57e408f2385a8b16745d3eb62b7c2e6e0eef7c05d37e4ba806e",
"x86_64-unknown-linux-musl": "e90c84c95440212e1c98d0bd7a54196746e886fdc8512ae7e8d6a7d46f058ef1",
},
"strip_prefix": "python",
},
"3.11.1": {
"url": "20230116/cpython-{python_version}+20230116-{platform}-{build}.tar.gz",
"sha256": {
Expand Down Expand Up @@ -485,6 +515,22 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
},
"3.11.14": {
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.tar.gz",
"sha256": {
"aarch64-apple-darwin": "29ec457de1b5765eeade189efbe27e2b1f8c7a96e4b79471b7d41a18094b1870",
"aarch64-unknown-linux-gnu": "d46c18f9da8a673cc55de55d8cfb8ed3164849eac50edc222985b60a9eda3be3",
"ppc64le-unknown-linux-gnu": "fd395aa11d82a48bfe3cfdfcd41759ee4b65b3d1de67466329aaef284164650b",
"riscv64-unknown-linux-gnu": "c3b529408c176a222c863c1810ee6a635a7e9deb5f2c73c425181a2383d7da2a",
"s390x-unknown-linux-gnu": "ade377b4668e4a03bd0c2a5316c079b8c0d2d63db7ecd05f24715309c4efb298",
"x86_64-apple-darwin": "ae375cd49fecfc3aecbf942544c34a1c5251f2c2f9b19e0e2b889a9113ccfa62",
"x86_64-pc-windows-msvc": "58a2571b5268fc7891e28cab01f23c3561ef5bc146f1314e32ba32a06754442b",
"aarch64-pc-windows-msvc": "67600a84ba1cf43a826a31c1dbb144b987a6b4627f6e5fb3d34a54511c356187",
"x86_64-unknown-linux-gnu": "848789e630ada4012e64ac744a3f4a8342b975d69f9608c460bdf9f370fa1d30",
"x86_64-unknown-linux-musl": "fed38a53fdff4327295f052a2970692ca194e53444843b5f91bd478c7ffed1ba",
},
"strip_prefix": "python",
},
"3.12.0": {
"url": "20231002/cpython-{python_version}+20231002-{platform}-{build}.tar.gz",
"sha256": {
Expand Down Expand Up @@ -609,6 +655,22 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
},
"3.12.12": {
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.tar.gz",
"sha256": {
"aarch64-apple-darwin": "2577a2629c89b3ff40dc16271cc8826d9ae20217e5a3189bbc7646b496e77687",
"aarch64-unknown-linux-gnu": "21bcf71dccb56ef611f50543b04e63e6585ac063463f2d248cb4ec28118d264d",
"aarch64-pc-windows-msvc": "a36719b442c22488f1ef7caea68943cf0c8dd367330fa5baac3cab4168a8e66a",
"ppc64le-unknown-linux-gnu": "782fbe38b63216cce3fdc4c7a2da86337ccef615fa9384acba7457ef17ad96a2",
"riscv64-unknown-linux-gnu": "c9bbb36a75466386497a38db0f9f707e63aaa8bae38c64d55683242d9b5b56a6",
"s390x-unknown-linux-gnu": "90e3f010692e65425cb503ae789e0ffefb3b5962b83e21d7c642d34cf056d48b",
"x86_64-apple-darwin": "c9fb9ab36c742f14388fd5b6a67cab5e6e1726b52624dafbd37d0176ad1752e1",
"x86_64-pc-windows-msvc": "c110c11de4299b0273caa99a1c7b895427c9441a231b3124bf5228a2e463ef43",
"x86_64-unknown-linux-gnu": "fbf55136d0f955ca2f93aeb7830f993d93acf1b9a729a15c3b6b5220a36bc835",
"x86_64-unknown-linux-musl": "bffd28435d28d55b33e0b90a5521b0220fe38c5ff67b2706cbc9ceb32af0e4a7",
},
"strip_prefix": "python",
},
"3.13.0": {
"url": "20241016/cpython-{python_version}+20241016-{platform}-{build}.{ext}",
"sha256": {
Expand Down Expand Up @@ -810,28 +872,73 @@ TOOL_VERSIONS = {
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
},
},
"3.13.8": {
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.{ext}",
"sha256": {
"aarch64-apple-darwin": "0dc9061b9d8e02a9344aa569eecb795f41f16ac8bb215f973d8db9179700e296",
"aarch64-unknown-linux-gnu": "1b9af3c628cdbef3b9eb4c61df628bbc54f4684ace147f3dc9850c336c44c125",
"ppc64le-unknown-linux-gnu": "c3bae08423519b5224bfc87323b96381bdb9c589fbdc09cd3ce289f6c1ea4ed3",
"riscv64-unknown-linux-gnu": "e8be781bfaf5ad6b83094db96dd60d7dfcd4519f6550740354b4ea57acfbfa21",
"s390x-unknown-linux-gnu": "3c9faf91356d06b4cc993487a71915e7a0585aa592691f6afe8841188e024653",
"x86_64-apple-darwin": "e3b692599bb3c247a2f95c21577f8b85b70924a5f2d672c9e0005608d7b9c907",
"x86_64-pc-windows-msvc": "1dde7aab47a52e81b6bd3f7d1bc5fa2f3c9e428eb5f54f51e8b92ae0a3e2409f",
"aarch64-pc-windows-msvc": "430d9073f22c744d6ea8c224d7b458a6be3620f9bd2389068908c214ea4423f8",
"aarch64-pc-windows-msvc-freethreaded": "187b962d84af18d22f67e069776dff61a223271ae11f44507cfd8693430c03c4",
"x86_64-unknown-linux-gnu": "12dd8995e8ec2df68cd1301b053f415c7884b8aae9d3459a2ac1448f781dbbbc",
"x86_64-unknown-linux-musl": "fbf17b5acd1a33a7a0a6bcabab7065f3adc3de77efbc230555a5019843070b1d",
"aarch64-apple-darwin-freethreaded": "0b7a80716c2557800d8e3133744b9e913476d259cea0160dd8597e58284a5a1c",
"aarch64-unknown-linux-gnu-freethreaded": "5cf655065b59493d39235fec0e30c33a5196bb01cf74cef50907a4f18c8ef02a",
"ppc64le-unknown-linux-gnu-freethreaded": "dbae65b6e747537939c3f2804077bb4e49f528850e68800d54b0e8c4b7768fab",
"riscv64-unknown-linux-gnu-freethreaded": "10390b394f76cb14c808b5c87de37189bc72796e55a55e6e5aca83e4615dd5ca",
"s390x-unknown-linux-gnu-freethreaded": "7e9d32fae045cefe950d8f95ddf1824edc232d1c67b4cdd55ecec5042f05727d",
"x86_64-apple-darwin-freethreaded": "1112caf275e374fbe629c3fde265f1e7675b21553f1607085cedc821d184a4aa",
"x86_64-pc-windows-msvc-freethreaded": "d4b83250fe9fea9563b2fb79111d4af072279b690507ddb14df11f617fd57f7e",
"x86_64-unknown-linux-gnu-freethreaded": "714eec8f42eb023d0c9ed289115d52e96ce73dac7464a5d242b0988eeda90b56",
},
"strip_prefix": {
"aarch64-apple-darwin": "python",
"aarch64-unknown-linux-gnu": "python",
"ppc64le-unknown-linux-gnu": "python",
"s390x-unknown-linux-gnu": "python",
"riscv64-unknown-linux-gnu": "python",
"x86_64-apple-darwin": "python",
"x86_64-pc-windows-msvc": "python",
"aarch64-pc-windows-msvc": "python",
"x86_64-unknown-linux-gnu": "python",
"x86_64-unknown-linux-musl": "python",
"aarch64-apple-darwin-freethreaded": "python/install",
"aarch64-unknown-linux-gnu-freethreaded": "python/install",
"ppc64le-unknown-linux-gnu-freethreaded": "python/install",
"riscv64-unknown-linux-gnu-freethreaded": "python/install",
"s390x-unknown-linux-gnu-freethreaded": "python/install",
"x86_64-apple-darwin-freethreaded": "python/install",
"x86_64-pc-windows-msvc-freethreaded": "python/install",
"aarch64-pc-windows-msvc-freethreaded": "python/install",
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
},
},
"3.14.0": {
"url": "20251007/cpython-{python_version}+20251007-{platform}-{build}.{ext}",
"url": "20251010/cpython-{python_version}+20251010-{platform}-{build}.{ext}",
"sha256": {
"aarch64-apple-darwin": "41c502cf32d650673bfbee35f73c9140897dd26c43b97da1177cee00f40033fb",
"aarch64-unknown-linux-gnu": "7b4fc36ee88ec693fcf7ac696bc018a8254a1f166f4cd5f6a352d5432cb5836a",
"ppc64le-unknown-linux-gnu": "e5df0738e3f7da9977d6b789fad0b3e8ccc117a3337bf6d4de673cd6472239c8",
"riscv64-unknown-linux-gnu": "cfff02bd9b3d6c64e2eacf725557599ce17f65e30776f41c0643613cbcf2042e",
"s390x-unknown-linux-gnu": "e2cbe581954685ae0a77206c8318c351e3a9d99b28924e3527610e76487c6201",
"x86_64-apple-darwin": "543accfe71df014a08295a4bbaa4e4cf2b80ab2977ec362e38be24c36076d7fe",
"x86_64-pc-windows-msvc": "77cd2c0e167726e0476e35c7e483cf2f05172dff2326e1c4bf9887aff8353b2f",
"aarch64-pc-windows-msvc": "52434459d376f3fc272596d7b5f97b2248e51362a6157091f9d64e630ddd8fdd",
"x86_64-unknown-linux-gnu": "8203b9355b605ad80be6f1aa467226cfbd55b9839063c173c494de5e69c4a722",
"x86_64-unknown-linux-musl": "6a0350e642dddc6c54f568c08239ca7af08cf8621d5797afc6a0df7c40b8eb7b",
"aarch64-apple-darwin-freethreaded": "72475196f0092d29bcd2fca298fe198cad135762118e8470083789a3e86cc30f",
"aarch64-unknown-linux-gnu-freethreaded": "c9f4550cdfe4d72c526a3aead8ff1f63a6f0e46cde3d64093177fa1b1944b662",
"ppc64le-unknown-linux-gnu-freethreaded": "2b39b7074a26d44f98275bfa6ea4128e691cc02409edc830dc1b8c19da38ec0f",
"riscv64-unknown-linux-gnu-freethreaded": "16a91fcf2b434c0ba48580aeccf61dfe682efbae5c05b21d0a7780b2cf20cd01",
"s390x-unknown-linux-gnu-freethreaded": "2e42043598543ccf92a5e58f55083ed12156f71cbfe4b2698d4f66dbe3864530",
"x86_64-apple-darwin-freethreaded": "7afbad6cc08072268ad9286dc16be5a04add68af2e3fbef69a429f0a223c275d",
"x86_64-pc-windows-msvc-freethreaded": "7ce62b9445d6d8a8518963e43eb655f5b9f7d08d084d7efc7164b1212fe13d16",
"aarch64-pc-windows-msvc-freethreaded": "87a9c334d1b591ad8561e74d70208eee4b86e23215af031ad7b445a694a45326",
"x86_64-unknown-linux-gnu-freethreaded": "254b71ac6c8557165d88fca355ca8861e303c726bd4ce100eead45d7fb59fb8a",
"aarch64-apple-darwin": "e97387b1fe9048b949cb6616af2984581e84cb068198f73e96d646e3efa33a53",
"aarch64-unknown-linux-gnu": "7464a4086f40ca91f015f147156698734fc8d9185b3d7a5c7d83877a7c182cf1",
"ppc64le-unknown-linux-gnu": "2383189e07675207733b4b155dcc89892d33b92d36e52cce9426d827c05e9b05",
"riscv64-unknown-linux-gnu": "842e1bf032f467cfba267c7db2e0c9344ccf9a58612d81437f8da70538b0d3aa",
"s390x-unknown-linux-gnu": "7b93d636e05aa3c42b971706280d3c2540eed3b18b10968809b1731d0969d6ed",
"x86_64-apple-darwin": "3f8ee5c2087e355188cb443250d4a8c1bffb3b5e751b61b423ac195bfd8dd87f",
"x86_64-pc-windows-msvc": "3d8b2cc6f554f3ad7e54837be51b9dbb1f228900e9acc098a713f6191d33e649",
"aarch64-pc-windows-msvc": "d63fa3939ffa91b73712ba276ca0235183f35fa896e689bae6e37f5d53a702d3",
"x86_64-unknown-linux-gnu": "cf872c369be9ed424092be50d4228ffc8b46469f18307e869023770dd3011aa3",
"x86_64-unknown-linux-musl": "a8b923c7a77e6b9e14018d2774663d538fe87c9da7ba0e081061d651f9802c19",
"aarch64-apple-darwin-freethreaded": "0f0c33fd55475e7192d08c6a37575412c4de886be438e4f359004994c83fc907",
"aarch64-unknown-linux-gnu-freethreaded": "531635fd1c064d03cd14f24b82c531a664de1b8998677eae4c9401b3c9330e26",
"ppc64le-unknown-linux-gnu-freethreaded": "9ea379e46fe0e9befccc24b9b244be9aef7c0589c857654cdb586e3d3ef62464",
"riscv64-unknown-linux-gnu-freethreaded": "63d6ba87237bc6804cb4ca5d87bb1c4267759b5211e434f0187babc5d1a6b12f",
"s390x-unknown-linux-gnu-freethreaded": "2e877903f2f266ec60b661e3b0b074908c8e1699449f907d403eb551e289fa48",
"x86_64-apple-darwin-freethreaded": "3ca690d329ec7d7b950a3430c859969dec6af9290c36d5107990bcbc04635d7c",
"x86_64-pc-windows-msvc-freethreaded": "60240e379461ac802cb6fc3e06a700557a22c616337458dedb94099eee8d2353",
"aarch64-pc-windows-msvc-freethreaded": "4d388a28cd002a3d5d4929b2a40d6341351fbdbbb5811f9bf07c8b3cc5812101",
"x86_64-unknown-linux-gnu-freethreaded": "ddab9e3f5da84f7a330df813d5736802beb0e7179aeaa20e7c2bc4623ec0db5c",
},
"strip_prefix": {
"aarch64-apple-darwin": "python",
Expand Down Expand Up @@ -860,11 +967,11 @@ TOOL_VERSIONS = {
# buildifier: disable=unsorted-dict-items
MINOR_MAPPING = {
"3.8": "3.8.20",
"3.9": "3.9.23",
"3.10": "3.10.18",
"3.11": "3.11.13",
"3.12": "3.12.11",
"3.13": "3.13.6",
"3.9": "3.9.24",
"3.10": "3.10.19",
"3.11": "3.11.14",
"3.12": "3.12.12",
"3.13": "3.13.8",
"3.14": "3.14.0",
}

Expand Down
20 changes: 6 additions & 14 deletions tests/python/python_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ def _test_toolchain_ordering(env):
toolchain = [
_toolchain("3.10"),
_toolchain("3.10.15"),
_toolchain("3.10.18"),
_toolchain(MINOR_MAPPING["3.10"]),
_toolchain("3.10.13"),
_toolchain("3.11.1"),
_toolchain("3.11.10"),
_toolchain("3.11.13", is_default = True),
_toolchain(MINOR_MAPPING["3.11"], is_default = True),
],
is_root = True,
),
Expand All @@ -315,26 +315,18 @@ def _test_toolchain_ordering(env):
for t in py.toolchains
]

env.expect.that_str(py.default_python_version).equals("3.11.13")
env.expect.that_dict(py.config.minor_mapping).contains_exactly({
"3.10": "3.10.18",
"3.11": "3.11.13",
"3.12": "3.12.11",
"3.13": "3.13.6",
"3.14": "3.14.0",
"3.8": "3.8.20",
"3.9": "3.9.23",
})
env.expect.that_str(py.default_python_version).equals(MINOR_MAPPING["3.11"])
env.expect.that_dict(py.config.minor_mapping).contains_exactly(MINOR_MAPPING)
env.expect.that_collection(got_versions).contains_exactly([
# First the full-version toolchains that are in minor_mapping
# so that they get matched first if only the `python_version` is in MINOR_MAPPING
#
# The default version is always set in the `python_version` flag, so know, that
# the default match will be somewhere in the first bunch.
"3.10",
"3.10.18",
MINOR_MAPPING["3.10"],
"3.11",
"3.11.13",
MINOR_MAPPING["3.11"],
# Next, the rest, where we will match things based on the `python_version` being
# the same
"3.10.15",
Expand Down