Skip to content

Commit 16c88a3

Browse files
committed
Fix Windows regression: use heredoc instead
This fixes regression in headless mode test that caused Windows CI/CD to fail with IndentationError. It replaces python -c multi-line string with heredoc to eliminate YAML indentation issues. Problem: - YAML run: | preserves leading whitespace from indentation - Multi-line Python code in -c had leading spaces on each line - Python interpreter rejected code with unexpected indent - Error: "Process completed with exit code 1" on Windows Root cause: python -c " from kconfiglib import Kconfig # ← Leading spaces from YAML import menuconfig # ← Causes IndentationError ... " Solution: - Use heredoc (python << 'EOF') instead of python -c - Heredoc is the standard bash method for multi-line input - Python receives clean code from stdin without leading spaces - Maintains code readability with proper formatting python << 'EOF' from kconfiglib import Kconfig import menuconfig ... EOF
1 parent 27a8a0d commit 16c88a3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,14 @@ jobs:
9292
# Use root dir for Windows, Kconfiglib subdir for Linux/macOS
9393
working-directory: ${{ matrix.target.headless-only && '.' || 'Kconfiglib' }}
9494
run: |
95-
python -c "
95+
python << 'EOF'
9696
from kconfiglib import Kconfig
9797
import menuconfig
98-
9998
print('Testing headless mode...')
10099
kconf = Kconfig('examples/Kmenuconfig')
101100
menuconfig.menuconfig(kconf, headless=True)
102-
print('Headless mode test passed')
103-
"
101+
print('Headless mode test passed')
102+
EOF
104103
105104
- name: Install windows-curses (Windows only)
106105
if: matrix.target.os == 'Windows'
@@ -112,4 +111,4 @@ jobs:
112111
# Use root dir for Windows (headless-only mode)
113112
working-directory: ${{ matrix.target.headless-only && '.' || 'Kconfiglib' }}
114113
run: |
115-
python -c "import menuconfig; print('menuconfig import successful')"
114+
python -c "import menuconfig; print('menuconfig import successful')"

0 commit comments

Comments
 (0)