fix: keep clean-clone release checks portable

This commit is contained in:
public-repo-gate
2026-09-16 00:30:29 +03:00
parent 2a1ce2297a
commit 24d0dc21b9
10 changed files with 1973 additions and 1941 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ export const UI_SHOT_NAMES = [
].flatMap(surface => ['light', 'dark'].flatMap(theme => [1, 2]
.map(scale => `${surface}-${theme}@${scale}x.png`)));
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const LOCALES = [['README.md', 'What This Is', 'Contents'], ['README.ru.md', 'Что это', 'Оглавление'], ['README.zh.md', '这是什么', '目录']];
const LOCALES = [['README.md', 'What this is', 'Contents'], ['README.ru.md', 'Что это', 'Оглавление'], ['README.zh.md', '这是什么', '目录']];
export const sha256 = bytes => createHash('sha256').update(bytes).digest('hex');
const requireThat = (condition, message) => { if (!condition) throw new Error(message); };
const sameNames = (actual, expected, label) => {
+13 -2
View File
@@ -37,8 +37,19 @@ import json
import sys
from pathlib import Path
import numpy as np
from PIL import Image
try:
import numpy as np
from PIL import Image
except ModuleNotFoundError as error:
if "--selftest" in sys.argv:
print(f"SELFTEST SKIP: нет необязательной dev-зависимости {error.name}")
raise SystemExit(0)
print(
"glass_probe требует dev-зависимости numpy и Pillow: "
"python3 -m pip install numpy Pillow",
file=sys.stderr,
)
raise SystemExit(2)
# Пороги приёмки. Держатся здесь, а не в голове: спор о том, стекло это или
# нет, решается сравнением с числом.
+4
View File
@@ -43,6 +43,10 @@ PYCMP
}
if [ "${1:-}" = "--selftest" ]; then
if ! python3 -c 'from PIL import Image, ImageChops' >/dev/null 2>&1; then
echo "SELFTEST SKIP: нет необязательной dev-зависимости Pillow"
exit 0
fi
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
ok=0
python3 - "$TMP" <<'PYGEN'
+4
View File
@@ -58,6 +58,10 @@ PYCHK
}
if [ "${1:-}" = "--selftest" ]; then
if ! python3 -c 'from PIL import Image, ImageDraw' >/dev/null 2>&1; then
echo "SELFTEST SKIP: нет необязательной dev-зависимости Pillow"
exit 0
fi
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
ok=0
python3 - "$TMP" <<'PYGEN'
+4
View File
@@ -48,6 +48,10 @@ PYOPT
}
if [ "${1:-}" = "--selftest" ]; then
if ! python3 -c 'from PIL import Image' >/dev/null 2>&1; then
echo "SELFTEST SKIP: нет необязательной dev-зависимости Pillow"
exit 0
fi
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
python3 - "$TMP" <<'PYGEN'
import sys
+11 -1
View File
@@ -19,7 +19,17 @@ import sys
import tempfile
from pathlib import Path
from PIL import Image, ImageStat
try:
from PIL import Image, ImageStat
except ModuleNotFoundError:
if "--selftest" in sys.argv:
print("SELFTEST SKIP: нет необязательной dev-зависимости Pillow")
raise SystemExit(0)
print(
"vstavit_ekran требует dev-зависимость Pillow: python3 -m pip install Pillow",
file=sys.stderr,
)
raise SystemExit(2)
def koefficienty(iz_uglov, v_ugly):