tests/semantic: standalone HERE sys.path boilerplate for 64 files (TEST-SEMANTIC-SYSPATH) #880

Closed
github-bot wants to merge 1 commit from gh-pr/880/head into gh-pr/880/base
Owner

@⁠morodirule on GitHub · 2026-11-24 14:54 UTC · original
fix/test-semantic-syspath → main · +508 −124 · 64 files · 1 commits · closed without merging

Claimed in the coordination issue as: TEST-SEMANTIC-SYSPATH

Carries abnalstlll-byte's finding (46 files, now 64 on current main): tests/semantic files importing support without the HERE insertion fail with ModuleNotFoundError when run directly by path.

Change: adds the standard guarded block

HERE = os.path.dirname(os.path.abspath(file))
if HERE not in sys.path:
sys.path.insert(0, HERE)

before the first same-dir import in 64 files, adding missing import os/sys and noqa E402 to match the other 400+ files. Five files with a misplaced bare HERE after the support import (far_branch, salu64/new_ops/int_ext/misc_ext fixtures) and buffer_formats_all now use the single guarded definition (ROOT/TOOLS_DIR derivations unchanged).

Tests: full translator suite via scripts/run_semantic_tests.py: 465 files, 6108 tests, 0 failed. Direct-by-path runs: 56 files print OK, 8 runner-less files import clean with exit 0; baseline of the same form fails with ModuleNotFoundError: No module named 'support' (checked via cd tests/semantic && python3 -I test_X.py). Hardware: Linux x86-64, no GPU needed. No game files, nothing online.

AI-assisted.

**@⁠morodirule** on GitHub · 2026-11-24 14:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/880) `fix/test-semantic-syspath` → `main` · +508 −124 · 64 files · 1 commits · closed without merging Claimed in the coordination issue as: TEST-SEMANTIC-SYSPATH Carries abnalstlll-byte's finding (46 files, now 64 on current main): tests/semantic files importing support without the HERE insertion fail with ModuleNotFoundError when run directly by path. Change: adds the standard guarded block HERE = os.path.dirname(os.path.abspath(__file__)) if HERE not in sys.path: sys.path.insert(0, HERE) before the first same-dir import in 64 files, adding missing import os/sys and noqa E402 to match the other 400+ files. Five files with a misplaced bare HERE after the support import (far_branch, salu64/new_ops/int_ext/misc_ext fixtures) and buffer_formats_all now use the single guarded definition (ROOT/TOOLS_DIR derivations unchanged). Tests: full translator suite via scripts/run_semantic_tests.py: 465 files, 6108 tests, 0 failed. Direct-by-path runs: 56 files print OK, 8 runner-less files import clean with exit 0; baseline of the same form fails with ModuleNotFoundError: No module named 'support' (checked via cd tests/semantic && python3 -I test_X.py). Hardware: Linux x86-64, no GPU needed. No game files, nothing online. AI-assisted.
Files importing support without the HERE insertion failed when run directly by path (ModuleNotFoundError: No module named 'support'). Adds the standard guarded block before the first same-dir import, with import os/sys and noqa E402 as in the other 400+ files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:26:07 +00:00
github-bot closed this pull request 2026-11-26 09:26:07 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.