-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use usr flags instead of platforms in transition
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
108 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("//python:versions.bzl", "TOOL_VERSIONS") | ||
load(":config_settings.bzl", "construct_config_settings") | ||
|
||
filegroup( | ||
name = "distribution", | ||
srcs = glob(["*.bzl"]) + [ | ||
"BUILD.bazel", | ||
], | ||
visibility = ["//python:__pkg__"], | ||
) | ||
|
||
construct_config_settings(python_versions = TOOL_VERSIONS.keys()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""This module is used to construct the config settings in the BUILD file in this same package. | ||
""" | ||
|
||
load("@bazel_skylib//rules:common_settings.bzl", "string_flag") | ||
|
||
# buildifier: disable=unnamed-macro | ||
def construct_config_settings(python_versions): | ||
"""Constructs a set of configs for all Python versions. | ||
Args: | ||
python_versions: The Python versions supported by rules_python. | ||
""" | ||
string_flag( | ||
name = "python_version", | ||
build_setting_default = python_versions[0], | ||
values = python_versions, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
for python_version in python_versions: | ||
python_version_constraint_setting = "is_python_" + python_version | ||
native.config_setting( | ||
name = python_version_constraint_setting, | ||
flag_values = {":python_version": python_version}, | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters