aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/main.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2024-10-21 18:17:09 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-23 16:41:42 +0200
commitc83e15fe6a52b2ce484f1e41f8306df2e5de1c7c (patch)
treed57e8f049885455b742aa9e77e88737cbcad7d15 /build_scripts/main.py
parent48f781be3fc667b45c39ff6a31e393de8ed17f24 (diff)
setup: fix PySide6.__all__ after the wheel split, amendment 2v6.8.0.2
When trying to write a module.__all__ variable without interference with different runtime folders, this version uses the __getattr__ support that Python 3.7 has introduced. This creates the __all__ variable on demand, when someone accesses that variable, for instance by "from PySide6 import *" which is the intended use. amends 703d975f16aff95bc9014a2689a3ae824b5a552f. Task-number: PYSIDE-1890 Change-Id: Ia4ead5bc7e499573d534ec7237b27ee737590a91 Fixes: PYSIDE-2895 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a27a9bf413288cbadf64188fe9a8a3fc6a6f1b9c)
Diffstat (limited to 'build_scripts/main.py')
-rw-r--r--build_scripts/main.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index cad754c4c..a7d837aaf 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -59,20 +59,6 @@ def elapsed():
return int(time.time() - start_time)
-def _fix_pyside_init_py(path):
- """For reproducible builds, strip out the part that contains the build-directory
- from PySide's __init__.py (PYSIDE-2895/QTBUG-105926)."""
- START_MARKER = "\n # Note: We should _not_ call this function"
- END_MARKER = "return __all__\n"
- contents = path.read_text(encoding='utf-8')
- start = contents.find(START_MARKER)
- end = contents.find(END_MARKER, start + len(START_MARKER)) if start != -1 else -1
- if end == -1:
- raise SetupError(f"Unable to fix {path}")
- fixed_contents = contents[:start] + contents[end + len(END_MARKER):]
- path.write_text(fixed_contents, encoding='utf-8')
-
-
def get_setuptools_extension_modules():
# Setting py_limited_api on the extension is the "correct" thing
# to do, but it doesn't actually do anything, because we
@@ -481,9 +467,6 @@ class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin):
log.warning(f'problem renaming "{self.st_build_dir}"')
log.warning(f'ignored error: {type(e).__name__}: {e}')
- if config.is_internal_pyside_build():
- _fix_pyside_init_py(_dst / "__init__.py")
-
else:
log.info("Skipped preparing and building packages.")
log.info(f"--- Build completed ({elapsed()}s)")