aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Love <335402+chrislovecnm@users.noreply.github.com>2023-07-10 16:11:35 -0600
committerGitHub <noreply@github.com>2023-07-10 22:11:35 +0000
commit523b9de1e9e8b1fc8cbfcb530ee8287bef13a736 (patch)
treeb4369310f26ce4cb26e550210b8aa1dc0ec1b921
parenta068d1bf6545fa74d52f6d73c2d79ec37f8ab6b9 (diff)
downloadbazelbuild-rules_python-523b9de1e9e8b1fc8cbfcb530ee8287bef13a736.tar.gz
fix(bzlmod)!: Changing repository name "python_aliases" to "python_versions" (#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 #1273
-rw-r--r--examples/bzlmod/BUILD.bazel4
-rw-r--r--examples/bzlmod/MODULE.bazel2
-rw-r--r--examples/bzlmod/tests/BUILD.bazel6
-rw-r--r--python/extensions/python.bzl2
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/bzlmod/BUILD.bazel b/examples/bzlmod/BUILD.bazel
index e788470..e08a062 100644
--- a/examples/bzlmod/BUILD.bazel
+++ b/examples/bzlmod/BUILD.bazel
@@ -8,8 +8,8 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@pip//:requirements.bzl", "all_requirements", "all_whl_requirements", "requirement")
load("@python_3_9//:defs.bzl", py_test_with_transition = "py_test")
-load("@python_aliases//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
-load("@python_aliases//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
+load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
+load("@python_versions//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
# This stanza calls a rule that generates targets for managing pip dependencies
diff --git a/examples/bzlmod/MODULE.bazel b/examples/bzlmod/MODULE.bazel
index 96b05be..be9466d 100644
--- a/examples/bzlmod/MODULE.bazel
+++ b/examples/bzlmod/MODULE.bazel
@@ -35,7 +35,7 @@ python.toolchain(
# See the tests folder for various examples on using multiple Python versions.
# The names "python_3_9" and "python_3_10" are autmatically created by the repo
# rules based on the `python_version` arg values.
-use_repo(python, "python_3_10", "python_3_9", "python_aliases")
+use_repo(python, "python_3_10", "python_3_9", "python_versions")
# This extension allows a user to create modifications to how rules_python
# creates different wheel repositories. Different attributes allow the user
diff --git a/examples/bzlmod/tests/BUILD.bazel b/examples/bzlmod/tests/BUILD.bazel
index d74f51c..ce7079c 100644
--- a/examples/bzlmod/tests/BUILD.bazel
+++ b/examples/bzlmod/tests/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@python_aliases//3.10:defs.bzl", py_binary_3_10 = "py_binary", py_test_3_10 = "py_test")
-load("@python_aliases//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
-load("@python_aliases//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
+load("@python_versions//3.10:defs.bzl", py_binary_3_10 = "py_binary", py_test_3_10 = "py_test")
+load("@python_versions//3.11:defs.bzl", py_binary_3_11 = "py_binary", py_test_3_11 = "py_test")
+load("@python_versions//3.9:defs.bzl", py_binary_3_9 = "py_binary", py_test_3_9 = "py_test")
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
py_binary(
diff --git a/python/extensions/python.bzl b/python/extensions/python.bzl
index b518b57..2d4032a 100644
--- a/python/extensions/python.bzl
+++ b/python/extensions/python.bzl
@@ -163,7 +163,7 @@ def _python_impl(module_ctx):
# This is require in order to support multiple version py_test
# and py_binary
multi_toolchain_aliases(
- name = "python_aliases",
+ name = "python_versions",
python_versions = {
version: entry.toolchain_name
for version, entry in global_toolchain_versions.items()