.
All checks were successful
CI / Check (push) Successful in 7m22s
Build and publish Docker image / build-and-push (push) Successful in 15m38s

This commit is contained in:
Andras Schmelczer 2026-05-18 21:20:31 +01:00
parent 6cc7288126
commit 2e112d7398
2 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View file

@ -23,3 +23,4 @@ video/auth.*
*.mp4
r5-java/tmp
property-data

25
pipeline/local_temp.py Normal file
View file

@ -0,0 +1,25 @@
"""Repo-local temporary directory helpers for pipeline scripts."""
from pathlib import Path
import os
import tempfile
REPO_ROOT = Path(__file__).resolve().parent.parent
LOCAL_TMP_DIR = REPO_ROOT / ".tmp"
_TEMP_ENV_VARS = ("TMPDIR", "TEMP", "TMP")
def local_tmp_dir() -> Path:
"""Return the repo-local temp directory, creating it if needed."""
LOCAL_TMP_DIR.mkdir(parents=True, exist_ok=True)
return LOCAL_TMP_DIR
def configure_tempfile_defaults() -> Path:
"""Point stdlib and subprocess temp defaults at the repo-local temp dir."""
temp_dir = local_tmp_dir()
temp_dir_str = str(temp_dir)
for env_var in _TEMP_ENV_VARS:
os.environ[env_var] = temp_dir_str
tempfile.tempdir = temp_dir_str
return temp_dir