Skip to content

Commit fa13efe

Browse files
committed
TST: Add exclude list to unicode-check
unicode-check was failing on some unicode characters that are included in tests for pybind11, which is a submodule of PRIMA. At first I tried to prevent submodules of PRIMA from being included, but apparently an explicit call to `git submodule ... --recursive` ignores fetchRecurseSubmodules (and this explicit call is done by the github checkout action when it is asked to fetch submodules recursively).
1 parent 93ad1d2 commit fa13efe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/unicode-check.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
extra_symbols = set(['®', 'ő', 'λ', 'π', 'ω', '∫', '≠', '≥', '≤', 'μ'])
1515
allowed = latin1_letters | box_drawing_chars | extra_symbols
1616

17+
# Some submodules have unicode characters in their tests. Since this is
18+
# unrelated to scipy we exclude them.
19+
exclude_directories = [
20+
'scipy/_lib/prima/python/pybind11'
21+
]
22+
1723

1824
def unicode_check(showall=False):
1925
"""
@@ -26,6 +32,8 @@ def unicode_check(showall=False):
2632
for name in chain(iglob('scipy/**/*.py', recursive=True),
2733
iglob('scipy/**/*.pyx', recursive=True),
2834
iglob('scipy/**/*.px[di]', recursive=True)):
35+
if any(excl_dir in name for excl_dir in exclude_directories):
36+
continue
2937
# Read the file as bytes, and check for any bytes greater than 127.
3038
with open(name, 'rb') as f:
3139
content = f.read()

0 commit comments

Comments
 (0)