Skip to content

Commit 523b9de

Browse files
authored
fix(bzlmod)!: Changing repository name "python_aliases" to "python_versions" (bazel-contrib#1304)
I think this name is more informative for a public API. The functionality it exposes are rules/macros that use a specific Python version to be used. These aren't really aliases. This commit renames "python_aliases" to "python_versions". This isn't technically a breaking change because bzlmod support is still beta, but we'll flag it as such just in case. BREAKING CHANGE: * The `python_aliases` repo is renamed to `python_versions`. You will need to either update references from `@python_aliases` to `@python_versions`, or use repo-remapping to alias the old name (`use_repo(python, python_aliases="python_versions")`) Closes bazel-contrib#1273
1 parent a068d1b commit 523b9de

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/bzlmod/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
load("@bazel_skylib//rules:build_test.bzl", "build_test")
99
load("@pip//:requirements.bzl", "all_requirements", "all_whl_requirements", "requirement")
1010
load("@python_3_9//:defs.bzl", py_test_with_transition = "py_test")
11-
load("@python_aliases//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
12-
load("@python_aliases//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
11+
load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
12+
load("@python_versions//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
1313
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
1414

1515
# This stanza calls a rule that generates targets for managing pip dependencies

examples/bzlmod/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python.toolchain(
3535
# See the tests folder for various examples on using multiple Python versions.
3636
# The names "python_3_9" and "python_3_10" are autmatically created by the repo
3737
# rules based on the `python_version` arg values.
38-
use_repo(python, "python_3_10", "python_3_9", "python_aliases")
38+
use_repo(python, "python_3_10", "python_3_9", "python_versions")
3939

4040
# This extension allows a user to create modifications to how rules_python
4141
# creates different wheel repositories. Different attributes allow the user

examples/bzlmod/tests/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
load("@python_aliases//3.10:defs.bzl", py_binary_3_10 = "py_binary", py_test_3_10 = "py_test")
2-
load("@python_aliases//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
3-
load("@python_aliases//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
1+
load("@python_versions//3.10:defs.bzl", py_binary_3_10 = "py_binary", py_test_3_10 = "py_test")
2+
load("@python_versions//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
3+
load("@python_versions//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
44
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
55

66
py_binary(

python/extensions/python.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _python_impl(module_ctx):
163163
# This is require in order to support multiple version py_test
164164
# and py_binary
165165
multi_toolchain_aliases(
166-
name = "python_aliases",
166+
name = "python_versions",
167167
python_versions = {
168168
version: entry.toolchain_name
169169
for version, entry in global_toolchain_versions.items()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy