From 1f8c9eb344224afb3872f5cd699c6aba1811b6fa Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Thu, 6 Aug 2026 13:53:01 -0700 Subject: [PATCH 1/2] Update OTS to v9.3.0 Bump the pinned OpenType Sanitizer version from 9.2.0 to 9.3.0: - setup.cfg: version and SHA-256 of the source tarball - run_tests.yml: --version/--sha256 for both the Linux and Windows "Download OTS source" steps - setup.py: LZ4_TAG 1.9.4 -> 1.10.0 to match OTS 9.3.0's updated lz4 wrap (brotli 1.1.0 and woff2 1.0.2 subproject dirs are unchanged) Skip the optional ots-python comparison tests when the installed opentype-sanitizer version differs from pyots's target OTS version. opentype-sanitizer is still 9.2.0 on PyPI, so its messages legitimately diverge from OTS 9.3.0; the tests auto-re-enable once it ships 9.3.0. --- .github/workflows/run_tests.yml | 6 +++--- setup.cfg | 4 ++-- setup.py | 2 +- tests/test_compare_ots_python.py | 34 +++++++++++++++++++++++++++++--- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 6c97cec..a353119 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -46,8 +46,8 @@ jobs: - name: Download OTS source run: | - python setup.py download --version=9.2.0 --sha256=1a1e50cd7ecea27c4ef04c5b1491c21e75555f35bf91e27103ede04ddd11e053 - + python setup.py download --version=9.3.0 --sha256=23814f8e90ee77379f54e86a012c09bba2d133940e5257546b29cf087a73beec + - name: Lint with ruff run: ruff check . @@ -87,7 +87,7 @@ jobs: - name: Download OTS source run: | - python setup.py download --version=9.2.0 --sha256=1a1e50cd7ecea27c4ef04c5b1491c21e75555f35bf91e27103ede04ddd11e053 + python setup.py download --version=9.3.0 --sha256=23814f8e90ee77379f54e86a012c09bba2d133940e5257546b29cf087a73beec - name: Build and install run: | diff --git a/setup.cfg b/setup.cfg index c0744e2..8dfe62c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [download] ; OpenType Sanitizer version that is downloaded from setup.py -version = 9.2.0 +version = 9.3.0 ; expected SHA-256 of the downloaded tarball. E.g. you can calculate it with: ; $ shasum -a 256 ots-X.X.X.tar.xz -sha256 = 1a1e50cd7ecea27c4ef04c5b1491c21e75555f35bf91e27103ede04ddd11e053 +sha256 = 23814f8e90ee77379f54e86a012c09bba2d133940e5257546b29cf087a73beec diff --git a/setup.py b/setup.py index 74d1282..f2f3606 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ # release of ots has something that causes this build to break anyway so it's # not really that urgent. We just have to adjust every release. BROTLI_TAG = "1.1.0" -LZ4_TAG = "1.9.4" +LZ4_TAG = "1.10.0" WOFF2_TAG = "1.0.2" diff --git a/tests/test_compare_ots_python.py b/tests/test_compare_ots_python.py index cdb2002..e153230 100644 --- a/tests/test_compare_ots_python.py +++ b/tests/test_compare_ots_python.py @@ -4,8 +4,11 @@ (opentype-sanitizer/ots) is not installed. """ +import configparser import functools import timeit +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as pkg_version from pathlib import Path import pytest @@ -26,6 +29,31 @@ TEST_FONTS_DIR = ROOT / "src" / "ots" / "tests" / "fonts" +def _ots_versions_match(): + """ + The comparison tests assert byte-identical messages between pyots and + ots-python, which only holds when both wrap the same OTS version. pyots + targets the version pinned in setup.cfg, while ots-python's package version + is its bundled OTS version. Skip the comparison when they differ (e.g. when + pyots is ahead of the latest opentype-sanitizer release), since the messages + legitimately diverge on OTS behavior changes. + """ + if not have_ots: + return False + cfg = configparser.ConfigParser() + cfg.read(ROOT / "setup.cfg") + target = cfg.get("download", "version", fallback=None) + try: + installed = pkg_version("opentype-sanitizer") + except PackageNotFoundError: + return False + return target is not None and target == installed + + +versions_match = _ots_versions_match() +SKIP_REASON = "ots-python not installed or its OTS version differs from pyots's target" + + def _get_ots_result(path): """ Sanitize with ots-python and process the result. @@ -42,7 +70,7 @@ def _get_pyots_result(path): return pyots.sanitize(path) -@pytest.mark.skipif(not have_ots, reason="ots-python not installed") +@pytest.mark.skipif(not versions_match, reason=SKIP_REASON) def test_compare_good(): tld = TEST_FONTS_DIR / "good" @@ -53,7 +81,7 @@ def test_compare_good(): assert otsp_result.messages == pyots_result.messages, f"[good] mismatched messages for {f}" -@pytest.mark.skipif(not have_ots, reason="ots-python not available") +@pytest.mark.skipif(not versions_match, reason=SKIP_REASON) def test_compare_bad(): tld = TEST_FONTS_DIR / "bad" @@ -64,7 +92,7 @@ def test_compare_bad(): assert otsp_result.messages == pyots_result.messages, f"[bad] mismatched messages for {f}" -@pytest.mark.skipif(not have_ots, reason="ots-python not available") +@pytest.mark.skipif(not versions_match, reason=SKIP_REASON) def test_compare_fuzzing(): tld = TEST_FONTS_DIR / "fuzzing" From 564b2f469dbfcbeb6d469ee60061db821fc9a1cd Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Fri, 7 Aug 2026 08:52:42 -0700 Subject: [PATCH 2/2] Re-trigger CI (Actions events dropped during GitHub outage)