From 76dfdf78f73005262da01271d2ffa0ef31ffe0be Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 19 May 2026 16:00:50 +0200 Subject: [PATCH] chore: drop Makefile trailing newline and reuse utils.PROJECT_ROOT in bundle_apps - utils/inventory/bundle_apps.py: replace the local REPO_ROOT `Path(__file__).resolve().parents[2]` with the canonical `from utils import PROJECT_ROOT`. Move `Iterable`/`Path` imports under `TYPE_CHECKING` since they are now only referenced in type hints. - Makefile: strip trailing newline from the redeploy-bundles target file. --- Makefile | 2 +- utils/inventory/bundle_apps.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f44b7620f0..70cca704bf 100644 --- a/Makefile +++ b/Makefile @@ -388,4 +388,4 @@ deploy-bundles: down up # Redeploy all apps cumulated from inventory bundles on an existing inventory (no down/up, no entity purge; requires a prior deploy-bundles run). redeploy-bundles: - @bash scripts/tests/deploy/local/deploy/redeploy-bundles.sh + @bash scripts/tests/deploy/local/deploy/redeploy-bundles.sh \ No newline at end of file diff --git a/utils/inventory/bundle_apps.py b/utils/inventory/bundle_apps.py index 39f3438211..d6d066af0f 100644 --- a/utils/inventory/bundle_apps.py +++ b/utils/inventory/bundle_apps.py @@ -14,15 +14,18 @@ from __future__ import annotations import argparse import sys -from pathlib import Path -from typing import Iterable +from typing import TYPE_CHECKING +from utils import PROJECT_ROOT from utils.cache.yaml import load_yaml -REPO_ROOT = Path(__file__).resolve().parents[2] +if TYPE_CHECKING: + from collections.abc import Iterable + from pathlib import Path + SEARCH_DIRS = ( - REPO_ROOT / "inventories" / "bundles" / "servers", - REPO_ROOT / "inventories" / "bundles" / "workstations", + PROJECT_ROOT / "inventories" / "bundles" / "servers", + PROJECT_ROOT / "inventories" / "bundles" / "workstations", )