|
17 | 17 | load("//python:repositories.bzl", "python_register_toolchains")
|
18 | 18 | load("//python/extensions/private:pythons_hub.bzl", "hub_repo")
|
19 | 19 | load("//python/private:toolchains_repo.bzl", "multi_toolchain_aliases")
|
| 20 | +load("//python/private:version_label.bzl", "version_label") |
20 | 21 |
|
21 | 22 | # This limit can be increased essentially arbitrarily, but doing so will cause a rebuild of all
|
22 | 23 | # targets using any of these toolchains due to the changed repository name.
|
@@ -75,7 +76,7 @@ def _python_impl(module_ctx):
|
75 | 76 |
|
76 | 77 | for toolchain_attr in mod.tags.toolchain:
|
77 | 78 | toolchain_version = toolchain_attr.python_version
|
78 |
| - toolchain_name = "python_" + toolchain_version.replace(".", "_") |
| 79 | + toolchain_name = "python_" + version_label(toolchain_version, sep = "_") |
79 | 80 |
|
80 | 81 | # Duplicate versions within a module indicate a misconfigured module.
|
81 | 82 | if toolchain_version in module_toolchain_versions:
|
@@ -165,7 +166,9 @@ def _python_impl(module_ctx):
|
165 | 166 | multi_toolchain_aliases(
|
166 | 167 | name = "python_versions",
|
167 | 168 | python_versions = {
|
168 |
| - version: entry.toolchain_name |
| 169 | + # NOTE @aignas 2023-07-24: we are effectively using the |
| 170 | + # version_label function to drop the patch version information. |
| 171 | + version_label(version, sep = "."): entry.toolchain_name |
169 | 172 | for version, entry in global_toolchain_versions.items()
|
170 | 173 | },
|
171 | 174 | )
|
|
0 commit comments