You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Five scripts repeat the same try/except import of ghcall #1283
Current gap: Each begins with try: from scripts.ghcall import ... except ImportError: from ghcall import ... so it works both imported by tests and run as a script, and tests/test_declared_dependencies.py needed a special case to treat scripts and every scripts/*.py stem as local.
Suggested approach: Pick one mechanism (for example putting the repository root on sys.path in one shared line, or making scripts runnable with python -m) and remove the repetition and the test special case.
Done when: no script has the try/except and the dependency test no longer lists scripts as local.
Left open on purpose. The repeated block is now the package-aware one (relative import when imported as scripts.<name>, a path insert plus a plain import when run directly) after the first version cached a stray scripts package from site-packages. Removing the repetition needs one mechanism that also works for runpy.run_path (used by a test), python3 scripts/<name>.py (the workflows, the Makefile and the pre-commit hooks) and imports by the tests; the only candidate that does is switching every invocation to python3 -m scripts.<name> (about fifteen call sites plus the test), which is a change of its own. Happy to do it as a separate change if that is the direction.
Activity
Import ghcall by package so a stray scripts package cannot shadow ours
yakew7 commentedon Nov 8, 2026
Left open on purpose. The repeated block is now the package-aware one (relative import when imported as
scripts.<name>, a path insert plus a plain import when run directly) after the first version cached a strayscriptspackage from site-packages. Removing the repetition needs one mechanism that also works forrunpy.run_path(used by a test),python3 scripts/<name>.py(the workflows, the Makefile and the pre-commit hooks) and imports by the tests; the only candidate that does is switching every invocation topython3 -m scripts.<name>(about fifteen call sites plus the test), which is a change of its own. Happy to do it as a separate change if that is the direction.