Skip to content

Commit e411d6b

Browse files
committed
Add PYTHONDEVMODE to improve tests
and other nice options like PYTHONMALLOC=debug_malloc (useful for ASan) and more rigorous warnings handling
1 parent 184cd1b commit e411d6b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
5959
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
6060
make -j $(nproc)
61+
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
6162
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
6263
make check TESTARGS="-platform offscreen"
6364
@@ -124,7 +125,9 @@ jobs:
124125
echo PYTHON_DIR=${PYTHON_DIR}
125126
qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \
126127
"PYTHON_VERSION=${PYTHON_VERSION_SHORT}" "PYTHON_DIR=${PYTHON_DIR}"
127-
make -j $(nproc) && make check TESTARGS="-platform offscreen"
128+
make -j $(nproc) && \
129+
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
130+
make check TESTARGS="-platform offscreen"
128131
129132
- name: Generate Wrappers
130133
run: |
@@ -208,6 +211,7 @@ jobs:
208211
PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \
209212
-r PythonQt.pro
210213
make -j $(nproc)
214+
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
211215
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
212216
make check TESTARGS="-platform offscreen"
213217
@@ -319,6 +323,9 @@ jobs:
319323
"PYTHON_PATH=%pythonLocation%" ^
320324
"PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" ^
321325
PythonQt.pro
326+
set PYTHONDEVMODE=1
327+
set PYTHONASYNCIODEBUG=1
328+
set PYTHONWARNINGS=error
322329
mingw32-make -j 2 && mingw32-make check "TESTARGS=-platform offscreen" ^
323330
|| nmake && nmake check "TESTARGS=-platform offscreen"
324331

.github/workflows/build_latest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
102102
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
103103
make -j $(nproc)
104+
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
104105
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
105106
make check TESTARGS="-platform offscreen"
106107
@@ -115,5 +116,8 @@ jobs:
115116
"PYTHON_PATH=%pythonLocation%" ^
116117
"PYTHON_VERSION=${{ steps.setenv.outputs.PYTHON_VERSION_SHORT }}" ^
117118
PythonQt.pro
119+
set PYTHONDEVMODE=1
120+
set PYTHONASYNCIODEBUG=1
121+
set PYTHONWARNINGS=error
118122
nmake && nmake check "TESTARGS=-platform offscreen"
119123

0 commit comments

Comments
 (0)