Skip to content
Merged
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: 2 additions & 6 deletions py/private/py_venv/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
virtualenv_name = os.path.basename(virtualenv_home)
runfiles_dir = os.path.realpath(os.environ["RUNFILES_DIR"])
builddir = os.path.realpath(os.environ["BUILD_WORKING_DIRECTORY"])

# Chop off the runfiles tree prefix
virtualenv_path = virtualenv_home.lstrip(runfiles_dir).lstrip("/")
# Chop off the repo name to get a repo-relative path
virtualenv_path = virtualenv_path[virtualenv_path.find("/"):]
target_package, target_name = os.environ["BAZEL_TARGET"].split("//", 1)[1].split(":")

PARSER = argparse.ArgumentParser(
prog="link",
Expand All @@ -36,7 +32,7 @@
PARSER.add_argument(
"--dest",
dest="dest",
default=os.path.join(builddir, os.path.dirname(virtualenv_path)),
default=os.path.join(builddir, target_package),
help="Dir to link the virtualenv into",
)

Expand Down
Loading