From fd319dc470289efc776583977918998472f931c9 Mon Sep 17 00:00:00 2001 From: pauljako Date: Sat, 5 Jul 2025 13:52:37 +0200 Subject: [PATCH] reworked dependency layout --- builder/__init__.py | 23 +++++++++++++++-------- rodeo-builder.json | 5 ++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/builder/__init__.py b/builder/__init__.py index 4707291..a151e0d 100755 --- a/builder/__init__.py +++ b/builder/__init__.py @@ -72,15 +72,20 @@ def build(path: str, output: str | None, should_compress: bool, compile_static: os.chdir(src_directory) + package_dependencies = {} + if "dependencies" in information: - if "build_packages" in information["dependencies"]: - for package in information["dependencies"]["build_packages"]: - if not package in []: - fail(f"The boundaries package {package} could not be found and is a build dependency") - if "build_commands" in information["dependencies"]: - for command in information["dependencies"]["build_commands"]: - if shutil.which(command) is None: - fail(f"The command {command} could not be found and is a build dependency") + if "build" in information["dependencies"]: + if "packages" in information["dependencies"]["build"]: + for package in information["dependencies"]["build"]["packages"]: + if not package in []: + fail(f"The rodeo package {package} could not be found or is not loaded.") + if "commands" in information["dependencies"]["build"]: + for command in information["dependencies"]["build"]["commands"]: + if shutil.which(command) is None: + fail(f"The command {command} could not be found and is a build dependency") + if "runtime" in information["dependencies"]: + package_dependencies = information["dependencies"]["runtime"] if "web_sources" in information and isinstance(information["web_sources"], dict) and len(information["web_sources"]) > 0: for org_url, org_path in information["web_sources"].items(): @@ -121,6 +126,8 @@ def build(path: str, output: str | None, should_compress: bool, compile_static: json_file["name"] = information["name"] json_file["version"] = information["version"] + json_file["dependencies"] = package_dependencies + with open("rodeo-package.json", "wt") as f: json.dump(json_file, f) diff --git a/rodeo-builder.json b/rodeo-builder.json index 16d9e49..ff87108 100644 --- a/rodeo-builder.json +++ b/rodeo-builder.json @@ -4,6 +4,9 @@ "version": "0.1", "build": "bash build.sh", "dependencies": { - "build_commands": ["pip"] + "build": { "commands": ["pip"] }, + "runtime": { + "python": "*" + } } }