• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1""" Define a custom transition that sets the pip_whl flag to no """
2
3def _flag_transition_impl(_settings, _ctx):
4    return {"//python/config_settings:pip_whl": "no"}
5
6flag_transition = transition(
7    implementation = _flag_transition_impl,
8    inputs = [],
9    outputs = ["//python/config_settings:pip_whl"],
10)
11
12# Define a rule that applies the transition to dependencies
13def _transition_rule_impl(_ctx):
14    return [DefaultInfo()]
15
16transition_rule = rule(
17    implementation = _transition_rule_impl,
18    attrs = {
19        "deps": attr.label_list(cfg = flag_transition),
20        "_allowlist_function_transition": attr.label(
21            default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
22        ),
23    },
24)
25