P-043c: install.sh — venv/ + .pytest_cache/ vom Deployment ausschließen (~200MB Bloat)

This commit is contained in:
Bernd (Hermes)
2026-08-09 20:31:14 +02:00
parent e559bdcff1
commit 2147984862
+17 -2
View File
@@ -417,12 +417,13 @@ deploy_plugin() {
# Rekursives Kopieren, __pycache__/*.pyc + Stray ~/ ausschließen
# Erkenntnis 3: Stray-Verzeichnis ~/ im Dev-Repo ausschließen
# Erkenntnis 4: find+cp statt tar (zuverlässigere Excludes)
# P-043c: venv/ + .pytest_cache/ ausschließen (Dev-Artefakte, ~200MB Bloat)
while read -r f; do
rel="${f#$src/}"
target="$dst/$rel"
mkdir -p "$(dirname "$target")"
cp "$f" "$target"
done < <(find "$src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/~/*')
done < <(find "$src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/~/*' ! -path '*/venv/*' ! -path '*/.pytest_cache/*')
# pycache aufräumen
find "$dst" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
@@ -533,7 +534,7 @@ migrate_to_userspace() {
target="$user_dst/$rel"
mkdir -p "$(dirname "$target")"
cp "$f" "$target"
done < <(find "$bundled_src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc')
done < <(find "$bundled_src" -type f ! -path '*/__pycache__/*' ! -name '*.pyc' ! -path '*/venv/*' ! -path '*/.pytest_cache/*')
ok "Plugin-Inhalt kopiert ($(find "$user_dst" -type f ! -path '*/__pycache__/*' | wc -l) Dateien)"
# c) Alten Bundled-Pfad leeren (NICHT das Verzeichnis selbst löschen)
@@ -1646,6 +1647,20 @@ if $UPDATE_ONLY; then
rm -rf "$HOME/.hermes/plugins/rocketchat"
log "Stale ~/.hermes/plugins/rocketchat/ gelöscht (alter falscher Pfad)"
fi
# P-043c: Stale venv/ + .pytest_cache/ aus altem Deploy bereinigen
if [ -d "$_update_dst/archivar/venv" ]; then
rm -rf "$_update_dst/archivar/venv"
log "Stale archivar/venv/ gelöscht (P-043c: Dev-Artefakt, ~200MB)"
fi
if [ -d "$_update_dst/.pytest_cache" ]; then
rm -rf "$_update_dst/.pytest_cache"
log "Stale .pytest_cache/ gelöscht (P-043c)"
fi
if [ -d "$_update_dst/archivar/.pytest_cache" ]; then
rm -rf "$_update_dst/archivar/.pytest_cache"
log "Stale archivar/.pytest_cache/ gelöscht (P-043c)"
fi
else
printf '%s[dry]%s find %s -type d -name __pycache__ -exec rm -rf {} +\n' "$C_YELLOW" "$C_RESET" "$_update_dst"
fi