Skip to content

Commit 9dc9650

Browse files
authored
chore: use modern helper from bazel-lib (#207)
1 parent 70b6697 commit 9dc9650

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

py/private/py_binary.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Implementation for the py_binary and py_test rules."
22

3-
load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION", "to_manifest_path")
3+
load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION", "to_rlocation_path")
44
load("@aspect_bazel_lib//lib:expand_make_vars.bzl", "expand_locations", "expand_variables")
55
load("//py/private:py_library.bzl", _py_library = "py_library_utils")
66
load("//py/private:providers.bzl", "PyWheelInfo")
@@ -32,16 +32,16 @@ def _py_binary_rule_imp(ctx):
3232
attribute_name = "env",
3333
)
3434

35-
python_interpreter_path = interpreter.python.path if interpreter.uses_interpreter_path else to_manifest_path(ctx, interpreter.python)
35+
python_interpreter_path = interpreter.python.path if interpreter.uses_interpreter_path else to_rlocation_path(ctx, interpreter.python)
3636

3737
common_substitutions = {
3838
"{{BASH_BIN}}": bash_bin,
3939
"{{BASH_RLOCATION_FN}}": BASH_RLOCATION_FUNCTION,
40-
"{{BINARY_ENTRY_POINT}}": to_manifest_path(ctx, main),
40+
"{{BINARY_ENTRY_POINT}}": to_rlocation_path(ctx, main),
4141
"{{INTERPRETER_FLAGS}}": " ".join(interpreter.flags),
4242
"{{PYTHON_INTERPRETER_PATH}}": python_interpreter_path,
4343
"{{RUN_BINARY_ENTRY_POINT}}": "true",
44-
"{{VENV_SOURCE}}": to_manifest_path(ctx, venv_info.venv_directory),
44+
"{{VENV_SOURCE}}": to_rlocation_path(ctx, venv_info.venv_directory),
4545
"{{VENV_NAME}}": "%s.venv" % ctx.attr.name,
4646
"{{PYTHON_ENV}}": "\n".join(dict_to_exports(env)).strip(),
4747
"{{PYTHON_ENV_UNSET}}": "\n".join(["unset %s" % k for k in env.keys()]).strip(),

py/private/venv/venv.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Implementations for the py_venv rule."
22

3-
load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION", "to_manifest_path")
3+
load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION", "to_rlocation_path")
44
load("//py/private:providers.bzl", "PyWheelInfo")
55
load("//py/private:py_library.bzl", _py_library = "py_library_utils")
66
load("//py/private:utils.bzl", "PY_TOOLCHAIN", "SH_TOOLCHAIN", "resolve_toolchain")
@@ -130,9 +130,9 @@ def _make_venv(ctx, name = None, strip_pth_workspace_root = None):
130130
substitutions = dict(
131131
common_substitutions,
132132
**{
133-
"{{PYTHON_INTERPRETER_PATH}}": to_manifest_path(ctx, interpreter.python),
134-
"{{WHL_REQUIREMENTS_FILE}}": to_manifest_path(ctx, whl_requirements),
135-
"{{PTH_FILE}}": to_manifest_path(ctx, pth),
133+
"{{PYTHON_INTERPRETER_PATH}}": to_rlocation_path(ctx, interpreter.python),
134+
"{{WHL_REQUIREMENTS_FILE}}": to_rlocation_path(ctx, whl_requirements),
135+
"{{PTH_FILE}}": to_rlocation_path(ctx, pth),
136136
"{{VENV_LOCATION}}": "${BUILD_WORKSPACE_DIRECTORY}/.%s" % name,
137137
"{{USE_MANIFEST_PATH}}": "true",
138138
}

0 commit comments

Comments
 (0)