fix(services): ignore tracked bytecode in the service-repo dirty check

Importing services rewrites upstream-committed __pycache__/*.pyc and was treated as local source edits, blocking refresh. Ignore bytecode and .DS_Store in the dirty check, restore those paths before pull, and disable bytecode writes while loading services.

Port of vinefeeder/TwinVine#18 (merged).
This commit is contained in:
Jon Gordon
2026-10-24 13:57:04 -06:00
committed by GitHub
parent 866420ed67
commit cd9785d406
2 changed files with 75 additions and 7 deletions
+4
View File
@@ -28,6 +28,10 @@ log = logging.getLogger("services")
DIRTY_REPOS: list[str] = []
SHADOWED: list[str] = []
# Service clones live inside the tree; writing bytecode there rewrites tracked ``.pyc``
# files (when upstream committed them) and floods untracked ``__pycache__`` dirs.
sys.dont_write_bytecode = True
def discover_services() -> tuple[list[Path], list[str]]:
"""Resolve the configured service dirs and glob every ``TAG/__init__.py``.