Skip to content

Commit ef61724

Browse files
committed
got basic test passing
1 parent 1e23941 commit ef61724

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

python/config_settings/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,13 @@ define_pypi_internal_flags(
230230
label_flag(
231231
name = "pip_platform_release_config",
232232
build_setting_default = ":_pip_platform_release_default_config",
233+
visibility = ["//visibility:public"],
233234
)
234235

235236
# docs: points to a label that provides BuildSettingInfo for the value.
236237
# A label and BuildSettingInfo are used for the same reason as platform_release
237238
label_flag(
238239
name = "pip_platform_version_config",
239240
build_setting_default = ":_pip_platform_version_default_config",
241+
visibility = ["//visibility:public"],
240242
)

python/private/pypi/dependency_specifier_flag.bzl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def _impl(ctx):
5454
runtime = ctx.toolchains[TARGET_TOOLCHAIN_TYPE].py3_runtime
5555
if runtime.interpreter_version_info:
5656
version_info = runtime.interpreter_version_info
57-
env["python_version"] = "{v.major}.{v.minor}".format(v = version_info)
57+
env["python_version"] = "{major}.{minor}".format(
58+
major = version_info.major,
59+
minor = version_info.minor,
60+
)
5861
full_version = format_full_version(version_info)
5962
env["python_full_version"] = full_version
6063
env["implementation_version"] = full_version
@@ -84,7 +87,7 @@ def _impl(ctx):
8487
env["platform_system"] = ctx.attr.platform_system
8588
env["platform_version"] = ctx.attr._platform_version_config_flag[BuildSettingInfo].value
8689

87-
if evaluate(ctx.attr.expression, env):
90+
if evaluate(ctx.attr.expression, env = env):
8891
value = "yes"
8992
else:
9093
value = "no"
@@ -128,8 +131,11 @@ def format_full_version(info):
128131
kind = kind[0] if kind else ""
129132
serial = str(info.serial) if info.serial else ""
130133

131-
return "{v.major}.{v.minor}.{v.micro}{kind}{serial}".format(
134+
return "{major}.{minor}.{micro}{kind}{serial}".format(
132135
v = info,
136+
major = info.major,
137+
minor = info.minor,
138+
micro = info.micro,
133139
kind = kind,
134140
serial = serial,
135141
)

tests/pypi/pep508/depspec_flag_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def _test_whatever(name):
1111
def impl(env, target):
1212
# todo: create FeatureFlagInfo subject
1313
actual = target[config_common.FeatureFlagInfo].value
14-
env.expect.that_string(actual).equals("yes")
14+
env.expect.that_str(actual).equals("yes")
1515

1616
depspec_flag(
1717
name = name + "_subject",

0 commit comments

Comments
 (0)