File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ sh_test(
9898 toolchains = ["//python:current_py_toolchain" ],
9999)
100100
101+ sh_test (
102+ name = "extract_root_test" ,
103+ srcs = ["extract_root_test.sh" ],
104+ data = [
105+ ":system_python_zipapp" ,
106+ ],
107+ env = {
108+ "ZIPAPP" : "$(rootpath :system_python_zipapp)" ,
109+ },
110+ )
111+
101112py_library (
102113 name = "some_dep" ,
103114 srcs = ["some_dep.py" ],
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Verify that the RULES_PYTHON_EXTRACT_ROOT env variable is respected.
3+
4+ set -euo pipefail
5+
6+ export RULES_PYTHON_EXTRACT_ROOT=" ${TEST_TMPDIR:-/ tmp} /extract_root_test"
7+
8+ echo " Running zipapp the first time..."
9+ " $ZIPAPP "
10+
11+ # Verify that the directory was created
12+ if [[ ! -d " $RULES_PYTHON_EXTRACT_ROOT " ]]; then
13+ echo " Error: Extract root directory $RULES_PYTHON_EXTRACT_ROOT was not created!"
14+ exit 1
15+ fi
16+
17+ # Run a second time to ensure it can re-extract successfully.
18+ echo " Running zipapp the second time..."
19+ " $ZIPAPP "
20+
21+ echo " Success!"
You can’t perform that action at this time.
0 commit comments