Skip to content

fix(venv_link): Correct name argument #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions e2e/use_release/minimal_download_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ fi
# Smoke test
bazel "--output_base=$OUTPUT_BASE" test --test_output=streamed //...

#############
# Smoke test py_venv_link
bazel "--output_base=$OUTPUT_BASE" run //src:venv
if ! [ -L ./.venv_named ]; then
>&2 echo "ERROR: The named venv target failed to respect venv_name"
exit 1
fi

#############
# Demonstrate that as configured we're fully on prebuilt toolchains even for crossbuilds
OUTPUT_BASE=$(mktemp -d)
Expand Down
11 changes: 10 additions & 1 deletion e2e/use_release/src/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_test")
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_test", "py_venv")

py_binary(
name = "main",
Expand All @@ -9,6 +9,15 @@ py_binary(
main = "__main__.py",
)

py_venv(
name = "venv",
srcs = [
"__init__.py",
"__main__.py",
],
venv_name = ".venv_named",
)

py_test(
name = "test",
srcs = ["my_test.py"],
Expand Down
2 changes: 1 addition & 1 deletion py/private/py_venv/py_venv.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def py_venv_link(venv_name = None, **kwargs):
link_script = str(Label("//py/private/py_venv:link.py"))
kwargs["debug"] = select({Label(":debug_build"): True, "//conditions:default": False})
py_venv_binary(
args = [] + (["--venv-name=" + venv_name] if venv_name else []),
args = [] + (["--name=" + venv_name] if venv_name else []),
main = link_script,
srcs = [link_script],
**kwargs
Expand Down
Loading