File indexing completed on 2026-10-08 08:36:30
0001 """Offline checks for running local Yall from the checkout inside eic-shell."""
0002 from pathlib import Path
0003 import subprocess
0004 import unittest
0005
0006 ROOT = Path(__file__).resolve().parents[2]
0007 ENV_EIC = ROOT / "examples/yall/lfhcal-simple/env-eic.sh"
0008 BOOTSTRAP = ROOT / "tools/bootstrap-yall-integration.sh"
0009
0010
0011 class EicYallSourceTest(unittest.TestCase):
0012 def test_env_eic_shell_syntax(self):
0013 subprocess.run(["bash", "-n", str(ENV_EIC)], check=True)
0014
0015 def test_env_eic_uses_checkout_not_user_site_install(self):
0016 text = ENV_EIC.read_text()
0017 self.assertIn('export PYTHONPATH="$_yall_src${PYTHONPATH:+:$PYTHONPATH}"', text)
0018 self.assertIn('python3 -m yall_run.cli "$@"', text)
0019 self.assertNotIn('site --user-base', text)
0020 self.assertNotIn('python3 -m pip install', text)
0021
0022 def test_bootstrap_has_one_host_install_and_container_source_smoke_test(self):
0023 text = BOOTSTRAP.read_text()
0024 self.assertEqual(text.count('python3 -m pip install --user -e "$YALL_DIR"'), 1)
0025 self.assertIn('source ./env-eic.sh >/dev/null && yall-run --version', text)
0026 self.assertNotIn('run-in-eic-shell.sh" "$EIC_SHELL" \\\n python3 -m pip install', text)
0027
0028
0029 if __name__ == "__main__":
0030 unittest.main()