From 18a825d07fd5aaa67956a145bf2370008805ca51 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 1 Jun 2025 09:34:45 -0400 Subject: [PATCH] chore(restructure_to_namespace): Always allow running restructuring The script is idempotent (all of the transformation regexps explicitly exclude matches that are already `glean.api_client`). --- .github/scripts/restructure_to_namespace.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/scripts/restructure_to_namespace.py b/.github/scripts/restructure_to_namespace.py index 5c277665..2fba986d 100755 --- a/.github/scripts/restructure_to_namespace.py +++ b/.github/scripts/restructure_to_namespace.py @@ -29,10 +29,6 @@ def update_imports_in_file(self, file_path: Path) -> bool: with open(file_path, "r", encoding="utf-8") as f: content = f.read() - # Skip if already contains api_client - if "api_client" in content: - return False - original_content = content # Apply the actual import transformations @@ -243,13 +239,6 @@ def run(self): shutil.rmtree(api_client_dir) print(f"Removed {api_client_dir}") - elif api_client_dir.exists() and any(api_client_dir.iterdir()): - print("✅ Already restructured - api_client/ exists and contains files") - print( - "If you want to force re-restructuring, delete src/glean/api_client/ first" - ) - return - print("Starting restructure...") print(f"Project root: {self.project_root}") print(f"Source dir: {self.src_dir}")