From 303744a3f8cf89a71de27cb981a475b4c4831696 Mon Sep 17 00:00:00 2001 From: max Date: Sat, 3 Oct 2026 20:22:07 +0200 Subject: [PATCH] Remove licensing repository dependency and standalone submodule proxy from tests and CI --- .gitea/workflows/ci.yml | 1 - compilation/generate_branding_assets.py | 9 ++++--- src/License_Authority.py | 1 - src/hub/License_Authority.py | 34 ------------------------- tests/test_hub_enrollment_pki_deep.py | 11 -------- 5 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 src/License_Authority.py delete mode 100644 src/hub/License_Authority.py diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8c85519..032e78c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - submodules: recursive - name: Verify Environment & Dependencies run: | diff --git a/compilation/generate_branding_assets.py b/compilation/generate_branding_assets.py index d0029ad..640a76b 100644 --- a/compilation/generate_branding_assets.py +++ b/compilation/generate_branding_assets.py @@ -14,9 +14,12 @@ import shutil ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ROOT_ASSETS_DIR = os.path.join(ROOT_DIR, "assets") COMPILATION_ASSETS_DIR = os.path.join(ROOT_DIR, "compilation", "assets") -LICENSING_ASSETS_DIR = os.path.join(ROOT_DIR, "LOGAR-LICENSING", "assets") +target_asset_dirs = [ROOT_ASSETS_DIR, COMPILATION_ASSETS_DIR] +licensing_dir = os.path.join(ROOT_DIR, "LOGAR-LICENSING") +if os.path.exists(licensing_dir): + target_asset_dirs.append(os.path.join(licensing_dir, "assets")) -for d in (ROOT_ASSETS_DIR, COMPILATION_ASSETS_DIR, LICENSING_ASSETS_DIR): +for d in target_asset_dirs: os.makedirs(d, exist_ok=True) @@ -419,7 +422,7 @@ def main(): swatch_svgs[name] = f'' # 6. Write to target directories - for target_dir in (ROOT_ASSETS_DIR, COMPILATION_ASSETS_DIR, LICENSING_ASSETS_DIR): + for target_dir in target_asset_dirs: swatch_dir = os.path.join(target_dir, "swatches") os.makedirs(swatch_dir, exist_ok=True) diff --git a/src/License_Authority.py b/src/License_Authority.py deleted file mode 100644 index 314d668..0000000 --- a/src/License_Authority.py +++ /dev/null @@ -1 +0,0 @@ -from src.hub.License_Authority import * \ No newline at end of file diff --git a/src/hub/License_Authority.py b/src/hub/License_Authority.py deleted file mode 100644 index c6b5342..0000000 --- a/src/hub/License_Authority.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 -""" -LOGAR Master License Authority Proxy -Delegates directly to the standalone submodule: LOGAR-LICENSING/License_Authority.py -Repo: https://gitea.eibl.tech/me0nline/LOGAR-LICENSING.git -""" - -import os -import importlib.util - -ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) -SUBMODULE_FILE = os.path.join(ROOT_DIR, "LOGAR-LICENSING", "License_Authority.py") -if not os.path.exists(SUBMODULE_FILE): - alt_sub = os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")), "LOGAR-LICENSING", "License_Authority.py") - if os.path.exists(alt_sub): - SUBMODULE_FILE = alt_sub - -if os.path.exists(SUBMODULE_FILE): - spec = importlib.util.spec_from_file_location("_submodule_authority", SUBMODULE_FILE) - if spec and spec.loader: - _sub = importlib.util.module_from_spec(spec) - spec.loader.exec_module(_sub) - # Export public symbols from submodule into this module's namespace - for attr in dir(_sub): - if not attr.startswith("__"): - globals()[attr] = getattr(_sub, attr) -else: - def main(): - print("[!] LOGAR-LICENSING submodule not present in current workspace.") - return 0 - -if __name__ == "__main__": - if "main" in globals(): - main() diff --git a/tests/test_hub_enrollment_pki_deep.py b/tests/test_hub_enrollment_pki_deep.py index d272b63..4492603 100644 --- a/tests/test_hub_enrollment_pki_deep.py +++ b/tests/test_hub_enrollment_pki_deep.py @@ -11,7 +11,6 @@ from unittest.mock import MagicMock, patch from src.hub import server_enrollment as enrollment from src.hub.pki_manager import PKIManager -from src.hub import License_Authority class TestHubEnrollmentPKIDeep(unittest.TestCase): @@ -96,16 +95,6 @@ class TestHubEnrollmentPKIDeep(unittest.TestCase): self.assertEqual(lic_data["format"], "LOGAR_LICENSE_REQUEST") self.assertIn("csr", lic_data) - def test_license_authority_cli_dispatch(self): - """Tests License Authority helper and CLI options.""" - try: - with patch("sys.argv", ["License_Authority.py", "--help"]): - ret = License_Authority.main() - if ret is not None: - self.assertEqual(ret, 0) - except SystemExit as cm: - self.assertEqual(cm.code, 0) - if __name__ == "__main__": unittest.main()