Skip to content

Commit 0ad7da0

Browse files
committed
Specifically make registry keys
1 parent b2f8b90 commit 0ad7da0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/test_pr_and_main.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,17 @@ jobs:
358358
# possibly if it outputs messages to stderr)
359359
conda install --update-deps -q -y $CONDA_DEPENDENCIES
360360
if test "${{matrix.TARGET}}" = 'win'; then
361-
echo "" > "$RUNNER_TEMP/pip-empty.ini"
362-
export PIP_CONFIG_FILE="$RUNNER_TEMP/pip-empty.ini"
363-
# persist for any subshells / subsequent steps that might run a replaced pip
364-
echo "PIP_CONFIG_FILE=$RUNNER_TEMP/pip-empty.ini" >> "$GITHUB_ENV"
365-
# belt & suspenders: set typical Windows dirs so platformdirs won't wander
366-
export PROGRAMDATA="${PROGRAMDATA:-C:\\ProgramData}"
367-
export APPDATA="${APPDATA:-$USERPROFILE\\AppData\\Roaming}"
368-
export LOCALAPPDATA="${LOCALAPPDATA:-$USERPROFILE\\AppData\\Local}"
361+
# Ensure the registry keys that platformdirs looks for actually exist
362+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^
363+
/v "Common AppData" /t REG_SZ /d "C:\ProgramData" /f
364+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" ^
365+
/v "AppData" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\AppData\Roaming" /f
366+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" ^
367+
/v "Local AppData" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\AppData\Local" /f
368+
# Helpful environment fallbacks (not strictly required once registry exists)
369+
echo "PROGRAMDATA=C:\ProgramData" >> "$GITHUB_ENV"
370+
echo "APPDATA=%USERPROFILE%\AppData\Roaming" >> "$GITHUB_ENV"
371+
echo "LOCALAPPDATA=%USERPROFILE%\AppData\Local" >> "$GITHUB_ENV"
369372
fi
370373
if test -z "${{matrix.slim}}"; then
371374
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely

0 commit comments

Comments
 (0)