diff options
| author | Christian Tismer <tismer@stackless.com> | 2024-10-21 18:17:09 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2024-10-22 14:56:57 +0000 |
| commit | a27a9bf413288cbadf64188fe9a8a3fc6a6f1b9c (patch) | |
| tree | 7963ac27fa7330795210064352358e8a6dcfc66f /build_scripts/main.py | |
| parent | d99a314f7cfe7a4572e90aa96e48a86cb4637360 (diff) | |
setup: fix PySide6.__all__ after the wheel split, amendment 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
Pick-to: 6.8 6.8.0
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts/main.py')
| -rw-r--r-- | build_scripts/main.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index 0c884cf44..0ea03bb9a 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)") |
