Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions python/config_settings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ load(
)
load(
"//python/private/pypi:flags.bzl",
"INTERNAL_FLAGS",
"UniversalWhlFlag",
"UseWhlFlag",
"WhlLibcFlag",
"define_pypi_internal_flags",
)
load(":config_settings.bzl", "construct_config_settings")

Expand Down Expand Up @@ -163,14 +163,6 @@ string_flag(
visibility = ["//visibility:public"],
)

# private pip whl related flags. Their values cannot be changed and they
# are an implementation detail of how `pip_config_settings` work.
[
string_flag(
name = "_internal_pip_" + flag,
build_setting_default = "",
values = [""],
visibility = ["//visibility:public"],
)
for flag in INTERNAL_FLAGS
]
define_pypi_internal_flags(
name = "define_pypi_internal_flags",
)
5 changes: 4 additions & 1 deletion python/private/pypi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ bzl_library(
bzl_library(
name = "flags_bzl",
srcs = ["flags.bzl"],
deps = ["//python/private:enum_bzl"],
deps = [
"//python/private:enum_bzl",
"@bazel_skylib//rules:common_settings",
],
)

bzl_library(
Expand Down
10 changes: 10 additions & 0 deletions python/private/pypi/flags.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ NOTE: The transitive loads of this should be kept minimal. This avoids loading
unnecessary files when all that are needed are flag definitions.
"""

load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("//python/private:enum.bzl", "enum")

# Determines if we should use whls for third party
Expand Down Expand Up @@ -68,3 +69,12 @@ INTERNAL_FLAGS = [
"whl_pycp3x_abi3",
"whl_pycp3x_abicp",
]

def define_pypi_internal_flags(name):
for flag in INTERNAL_FLAGS:
string_flag(
name = "_internal_pip_" + flag,
build_setting_default = "",
values = [""],
visibility = ["//visibility:public"],
)