aboutsummaryrefslogtreecommitdiffstats
path: root/create_wheels.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-01-23 19:15:58 +0100
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-01-23 19:35:02 +0100
commit39ab1a9f93dba84af6e179edb9dfb7c3a1ca3cf4 (patch)
tree6eed34fa6517c81b1297de7fe228919484cea48c /create_wheels.py
parenta38aa4d9b6542927c1626fc152f550653bfd0e5f (diff)
build: check module consistency for wheels
A few modules have been excluded in releases because we haven't noticed they are missing from the wheels. This adds a small check to the wheel creation, so we can be aware of this situation. A similar check is done with the README content, which is what we list we are including in the wheels. Pick-to: 6.6 Change-Id: I719e7d35b1466329a537c6095af01e705b7c6bea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'create_wheels.py')
-rw-r--r--create_wheels.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/create_wheels.py b/create_wheels.py
index d70431ecc..5a157183a 100644
--- a/create_wheels.py
+++ b/create_wheels.py
@@ -13,6 +13,7 @@ from typing import List, Optional, Tuple
import build # type: ignore
import pyproject_hooks
+import build_scripts.wheel_files
from build_scripts.wheel_files import (ModuleData, # type: ignore
set_pyside_package_path,
wheel_files_pyside_addons,
@@ -333,6 +334,33 @@ def get_build_directory(options: Namespace):
raise Exception("Unable to determine build directory, no matching virtual environment found")
+def check_modules_consistency():
+ available_functions = dir(build_scripts.wheel_files)
+ functions = [i.replace("module_", "") for i in available_functions if i.startswith("module_")]
+
+ sources = [i.stem for i in Path("sources/pyside6/PySide6/").glob("Qt*")]
+
+ missing_modules = set(sources) - set(functions)
+
+ if len(missing_modules):
+ print("Warning: the following modules don't have a function "
+ f"in 'build_scripts/wheel_files.py':\n {missing_modules}")
+
+ # Check READMEs
+ readme_modules = set()
+ for r in Path(".").glob("README.pyside6*"):
+ with open(r) as f:
+ for line in f:
+ if line.startswith("* Qt"):
+ readme_modules.add(line.strip().replace("* ", ""))
+
+ missing_modules_readme = set(sources) - readme_modules
+
+ if len(missing_modules_readme):
+ print("Warning: the following modules are not in READMEs :"
+ f"\n {missing_modules_readme}")
+
+
if __name__ == "__main__":
parser = ArgumentParser()
@@ -351,6 +379,10 @@ if __name__ == "__main__":
)
options = parser.parse_args()
+ # Sanity check between the available modules,
+ # and the functions in build_scripts/wheel_files.py
+ check_modules_consistency()
+
build_directory = get_build_directory(options)
verbose = False