Repository navigation
Commit c534ecd
committed
fix(cuda_core): force UTF-8 mode for stubgen-pyx pre-commit hook
Windows CI (and local Windows developers) were regenerating .pyi files
with corrupted non-ASCII characters (e.g. Kepler(TM) -> Kepler mojibake).
stubgen-pyx's `include`-directive expansion reads .pxi files via
`Path.read_text()` with no explicit encoding, which falls back to the
platform's default (cp1252 on Windows) instead of UTF-8. `_device.pyx`
pulls in several .pxi files with UTF-8 docstring content ("Kepler(TM)",
"(in {mu}s)"), so this only surfaces there.
Invoke stubgen-pyx via `python -X utf8 -m stubgen_pyx` so Python's UTF-8
mode is forced regardless of platform locale, matching what the old
toolshed/run_stubgen_pyx.py wrapper did via PYTHONUTF8=1 before it was
removed. Putting this in .pre-commit-config.yaml (rather than only in
CI) means local Windows developers get the same fix.
This also revert the temporary --show-diff-on-failure diagnostic flag
added to track down the mismatch.
Root cause filed upstream: jon-edward/stubgen-pyx#41 (encoding fix was
incomplete - it covered top-level .pyx/.pxd reads but missed the
include-expansion path in file_parsing.py).1 parent 7d19656 commit c534ecd
2 files changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
0 commit comments