From 84fcc7f2de899557416efdc9abdedb92c882c165 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 17 Feb 2024 02:07:33 +0100 Subject: [PATCH] [WIP] improve module check --- setup.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 52f2abfa..0a755299 100755 --- a/setup.py +++ b/setup.py @@ -150,29 +150,37 @@ def qt_download_check_extract(cfg, dir_install): module = "{module}", compiler = compiler) + qt_modules = cfg['versions']['qt_modules'] + extra_package_names = list() - for module in cfg['versions']['qt_modules']: + for module in qt_modules: extra_package_names.append(extra_package_name.format(module = module)) package_archives = dict() for package in metadata.iter("PackageUpdate"): + print("package check", package.find("Name").text, [base_package_name] + extra_package_names) if package.find("Name").text in [base_package_name] + extra_package_names: package_archives[package.find("Name").text] = { "version": package.find("Version").text, "archives": read_downloadable_archives(package) } - archives_match = [] - for module_name in cfg['versions']['qt_modules']: + # TODO: better check + if not package_archives: + raise RuntimeError("no package_archives") + + module_archives = dict() + for module_name in qt_modules: for package_name, data in package_archives.items(): for archive_name in data["archives"]: if archive_name.startswith(module_name): - archives_match.append([package_name, data["version"], archive_name]) + module_archives[module_name].append([package_name, data["version"], archive_name]) - if not archives_match: - raise RuntimeError(f"no matches for Qt modules ({cfg['versions']['qt_modules']}) found") + modules_missing = qt_modules - module_archives.keys() + if modules_missing: + raise RuntimeError(f"no matches for Qt modules {modules_missing} found") - for package_name, package_version, archive_name in archives_match: + for package_name, package_version, archive_name in module_archives.values(): url_archive = base_url+'/'+package_name+'/'+package_version+archive_name print("download", url_archive)