pheon/tools/check_installed.py
Jan Petykiewicz b3346b40a4 Introduce Pheon GDSII parsing and layout review tools
Implement native GDSII reading and writing with Arrow interchange, hierarchy
scans and selective cell loading. Validate numeric packing and array pitches,
and preserve normalized REAL8 encodings exactly within the supported range.

Add standalone dump, structural diff, hierarchy, layer-name annotation and Git
diff commands. Provide scoped text and JSON reports, deterministic comparison,
and record-preserving metadata edits.

Package the shared library and optional Python Arrow readers as pheon using
CFFI ABI mode and Python-independent platform wheels. Include locked source
builds, native API checks, cross-platform artifact workflows, documentation
and regression coverage. Require Rust 1.88 or newer and Python 3.11 or newer.

Validation: 87 native tests, 14 binding tests on Python 3.11/3.13/3.14,
and 71 installed companion integration tests pass. Full, scanned and selected
Arrow layouts match the previous schemas.
2026-11-16 16:21:21 -08:00

26 lines
829 B
Python

"""Run outside the checkout, without PHEON_LIBRARY, after installing a wheel."""
from pathlib import Path
import subprocess
import sys
import unittest
ROOT = Path(__file__).resolve().parents[1]
# A separate interpreter verifies that base packing does not import PyArrow.
subprocess.run(
[sys.executable, "-I", "-c", """
import importlib.util
import sys
import pheon
from pheon._native import library
assert 'pyarrow' not in sys.modules
assert importlib.util.find_spec('klamath_rs_ext') is None
assert library.parent == __import__('pathlib').Path(pheon.__file__).parent
assert pheon.pack_int2([1, -2]) == bytes.fromhex('0001fffe')
"""],
check=True,
)
suite = unittest.defaultTestLoader.discover(str(ROOT / "tests/python"))
if not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful():
raise SystemExit(1)