From eb7b9738b224cb1d63bec7c8d0e18de383cfaf94 Mon Sep 17 00:00:00 2001 From: Channing Conger Date: Wed, 10 Jun 2026 17:40:48 -0700 Subject: [PATCH] Remove package layout build tooling test --- scripts/codex_package/test_layout.py | 79 ---------------------------- 1 file changed, 79 deletions(-) delete mode 100644 scripts/codex_package/test_layout.py diff --git a/scripts/codex_package/test_layout.py b/scripts/codex_package/test_layout.py deleted file mode 100644 index bd3e7bfa9e..0000000000 --- a/scripts/codex_package/test_layout.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path -import sys -import tempfile -import unittest - -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) - -from codex_package.layout import build_package_dir -from codex_package.layout import validate_package_dir -from codex_package.targets import PACKAGE_VARIANTS -from codex_package.targets import PackageInputs -from codex_package.targets import TARGET_SPECS - - -class PackageLayoutTest(unittest.TestCase): - def test_code_mode_host_is_packaged_and_required(self) -> None: - with tempfile.TemporaryDirectory() as temp_dir: - root = Path(temp_dir) - package_dir = root / "package" - package_dir.mkdir() - entrypoint = touch_file(root / "codex") - code_mode_host = touch_file(root / "codex-code-mode-host") - rg = touch_file(root / "rg") - spec = TARGET_SPECS["aarch64-apple-darwin"] - variant = PACKAGE_VARIANTS["codex"] - - build_package_dir( - package_dir, - "0.0.0-test", - variant, - spec, - PackageInputs( - entrypoint_bin=entrypoint, - code_mode_host_bin=code_mode_host, - rg_bin=rg, - zsh_bin=None, - bwrap_bin=None, - codex_command_runner_bin=None, - codex_windows_sandbox_setup_bin=None, - ), - ) - - packaged_host = package_dir / "bin" / "codex-code-mode-host" - self.assertTrue(packaged_host.is_file()) - self.assertTrue(packaged_host.stat().st_mode & 0o100) - metadata = json.loads( - (package_dir / "codex-package.json").read_text(encoding="utf-8") - ) - self.assertEqual(metadata["codeModeHost"], "bin/codex-code-mode-host") - validate_package_dir( - package_dir, - variant, - spec, - include_zsh=False, - ) - - packaged_host.unlink() - with self.assertRaisesRegex( - RuntimeError, - "Missing package file: bin/codex-code-mode-host", - ): - validate_package_dir( - package_dir, - variant, - spec, - include_zsh=False, - ) - - -def touch_file(path: Path) -> Path: - path.touch() - return path - - -if __name__ == "__main__": - unittest.main()