pheon/tools/check_installed.py
Jan Petykiewicz f474e9848c Require PyArrow in the Python package
Keep the arrow extra available for existing requirements. Update wheel checks and install instructions, and verify that integer packing leaves PyArrow unloaded.
2026-11-18 12:36:58 -08:00

26 lines
832 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 checks that PyArrow stays unloaded during packing.
subprocess.run(
[sys.executable, "-I", "-c", """
import sys
from importlib.metadata import version
import pheon
from pheon._native import library
assert pheon.__version__ == version('pheon')
assert library.parent == __import__('pathlib').Path(pheon.__file__).parent
assert pheon.pack_int2([1, -2]) == bytes.fromhex('0001fffe')
assert 'pyarrow' not in sys.modules
"""],
check=True,
)
suite = unittest.defaultTestLoader.discover(str(ROOT / "tests/python"))
if not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful():
raise SystemExit(1)