Skip to content

Commit 2f1b528

Browse files
committed
minor cleanup, doc
1 parent 7dae5d0 commit 2f1b528

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

python/private/pypi/env_marker_setting.bzl

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ load(":pep508_evaluate.bzl", "evaluate")
88
_os_name_select_map = {
99
# The "java" value is documented, but with Jython defunct,
1010
# shouldn't occur in practice.
11-
# The osname value is technically a property of the runtime, not the
12-
# targetted OS at runtime, but the distinction shouldn't matter in
13-
# practice.
11+
# The os.name value is technically a property of the runtime, not the
12+
# targetted runtime OS, but the distinction shouldn't matter if
13+
# things are properly configured.
1414
"@platforms//os:windows": "nt",
1515
"//conditions:default": "posix",
1616
}
@@ -103,7 +103,16 @@ _platform_system_select_map = {
103103
}
104104

105105
def env_marker_setting(**kwargs):
106+
"""Creates an env_marker setting.
107+
108+
Args:
109+
name: {type}`str` target name
110+
expression: {type}`str` the environment marker string to evaluate
111+
**kwargs: {type}`dict` additionally common kwargs.
112+
"""
106113
_env_marker_setting(
114+
name = name,
115+
expression = expression,
107116
os_name = select(_os_name_select_map),
108117
sys_platform = select(_sys_platform_select_map),
109118
platform_machine = select(_platform_machine_select_map),
@@ -180,7 +189,11 @@ def _env_marker_setting_impl(ctx):
180189

181190
_env_marker_setting = rule(
182191
doc = """
183-
Config setting to evaluate a PyPA environment marker expression.
192+
Evaluates an environment marker expression using target configuration info.
193+
194+
See
195+
https://packaging.python.org/en/latest/specifications/dependency-specifiers
196+
for the specification of behavior.
184197
""",
185198
implementation = _env_marker_setting_impl,
186199
attrs = {

0 commit comments

Comments
 (0)