-
-
Notifications
You must be signed in to change notification settings - Fork 636
fix(bzlmod): set the default_version to the python_version flag #2253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
2c1d0f4
dba9902
88cad95
c6e10d6
dde6f2f
ac06a1e
ab73e16
e4cc572
7e50e9f
6a9a53f
6cbe12a
19f50d2
0ee8ada
3c770d0
81c5e79
d53bc4a
b2378ff
b03beb1
e6bb17d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,25 @@ load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_in | |
load("@rules_bazel_integration_test//bazel_integration_test:repo_defs.bzl", "bazel_binaries") | ||
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") | ||
load("//:version.bzl", "SUPPORTED_BAZEL_VERSIONS") | ||
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility | ||
load("//python/private:internal_config_repo.bzl", "internal_config_repo") # buildifier: disable=bzl-visibility | ||
load("//python/private:pythons_hub.bzl", "hub_repo") # buildifier: disable=bzl-visibility | ||
load("//python/private/pypi:deps.bzl", "pypi_deps") # buildifier: disable=bzl-visibility | ||
|
||
def rules_python_internal_setup(): | ||
"""Setup for rules_python tests and tools.""" | ||
|
||
internal_config_repo(name = "rules_python_internal") | ||
if not BZLMOD_ENABLED: | ||
hub_repo( | ||
name = "pythons_hub", | ||
minor_mapping = {}, | ||
|
||
default_python_version = "", | ||
toolchain_prefixes = [], | ||
toolchain_python_versions = [], | ||
toolchain_set_python_version_constraints = [], | ||
toolchain_user_repository_names = [], | ||
) | ||
|
||
# Because we don't use the pip_install rule, we have to call this to fetch its deps | ||
pypi_deps() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,9 +109,14 @@ def config_settings( | |
|
||
for python_version in [""] + python_versions: | ||
is_python = "is_python_{}".format(python_version or "version_unset") | ||
native.alias( | ||
|
||
# Do not rely on aliases in the `rules_python` so that we can just blindly | ||
aignas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# add all of the found wheels on the internet to the select statement. | ||
native.config_setting( | ||
name = is_python, | ||
actual = Label("//python/config_settings:" + is_python), | ||
flag_values = { | ||
Label("//python/config_settings:_python_version_major_minor"): python_version, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, maybe we should expose python_version_major_minor as a public setting. Otherwise, users don't have a good way to perform e.g. Don't have to address in this PR though. |
||
}, | ||
visibility = visibility, | ||
) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.