File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ if $PYTHON_BINARY -m hatch --version; then
13
13
$PYTHON_BINARY -m hatch run " $@ "
14
14
}
15
15
else # No toolchain hatch present, set up virtualenv before installing hatch
16
- createvirtualenv " $PYTHON_BINARY " hatchenv
17
- trap " deactivate; rm -rf hatchenv" EXIT HUP
16
+ # Use a random venv name because the encryption tasks run this script multiple times in the same run.
17
+ ENV_NAME=hatchenv-$RANDOM
18
+ createvirtualenv " $PYTHON_BINARY " $ENV_NAME
19
+ # shellcheck disable=SC2064
20
+ trap " deactivate; rm -rf $ENV_NAME " EXIT HUP
18
21
python -m pip install -q hatch
19
22
run_hatch () {
20
23
python -m hatch run " $@ "
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ find_python3() {
43
43
createvirtualenv () {
44
44
PYTHON=$1
45
45
VENVPATH=$2
46
- rm -rf $VENVPATH
46
+
47
47
# Prefer venv
48
48
VENV=" $PYTHON -m venv"
49
49
if [ " $( uname -s) " = " Darwin" ]; then
You can’t perform that action at this time.
0 commit comments