File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,22 @@ if [ -n "$SKIP_HATCH" ]; then
18
18
run_hatch () {
19
19
bash ./.evergreen/run-tests.sh
20
20
}
21
- elif $PYTHON_BINARY -m hatch --version; then
22
- run_hatch () {
23
- $PYTHON_BINARY -m hatch run " $@ "
24
- }
25
- else # No toolchain hatch present, set up virtualenv before installing hatch
21
+ else # Set up virtualenv before installing hatch
26
22
# Use a random venv name because the encryption tasks run this script multiple times in the same run.
27
23
ENV_NAME=hatchenv-$RANDOM
28
24
createvirtualenv " $PYTHON_BINARY " $ENV_NAME
29
25
# shellcheck disable=SC2064
30
26
trap " deactivate; rm -rf $ENV_NAME " EXIT HUP
31
27
python -m pip install -q hatch
28
+
29
+ # Ensure hatch does not write to user or global locations.
30
+ touch hatch_config.toml
31
+ HATCH_CONFIG=$( pwd) /hatch_config.toml
32
+ export HATCH_CONFIG
33
+ hatch config restore
34
+ hatch config set dirs.data " .hatch/data"
35
+ hatch config set dirs.cache " .hatch/cache"
36
+
32
37
run_hatch () {
33
38
python -m hatch run " $@ "
34
39
}
You can’t perform that action at this time.
0 commit comments