SG-30385 Add Qt LGPL license compatibility shim for older tk-desktop builds#155
Draft
julien-lang wants to merge 1 commit intomasterfrom
Draft
SG-30385 Add Qt LGPL license compatibility shim for older tk-desktop builds#155julien-lang wants to merge 1 commit intomasterfrom
julien-lang wants to merge 1 commit intomasterfrom
Conversation
…builds When SGD ships a new version that uses PySide6 under LGPL, the About box Licenses dialog must reflect the correct attribution even if the studio's Toolkit config pins an older tk-desktop build that still has hardcoded PySide version strings. Add _patch_pyside_license() which runs after tk-desktop is bootstrapped: - If the loaded tk-desktop already exposes Licenses.get_pyside_license_html() (i.e. the fix from SG-42871 is present), the function does nothing. - Otherwise it monkey-patches Licenses.__init__ to re-render the license HTML with the correct LBP-approved Qt LGPL wording and the actual PySide version detected at runtime. The entire function is wrapped in a broad except so that any failure is silently logged and never surfaces to the user. The patch is applied at most once (guarded by _sgd_lgpl_patched attribute). Call site: __post_bootstrap_engine(), immediately after the engine is loaded and before the Qt event loop starts.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #155 +/- ##
=========================================
- Coverage 10.30% 9.70% -0.61%
=========================================
Files 13 13
Lines 582 618 +36
=========================================
Hits 60 60
- Misses 522 558 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compatibility shim for the Qt LGPL license fix in tk-desktop (SG-42871).
Changes
_patch_pyside_license()called in__post_bootstrap_engine(), immediately after the engine is loaded and before the Qt event loop starts. If the loaded tk-desktop is old (noget_pyside_license_htmlmethod), the function monkey-patchesLicenses.__init__to re-render the license HTML with the correct LBP-approved LGPL wording and the actual PySide version detected at runtime. The entire function is wrapped in a broad except - any failure is silently logged and never surfaces to the user.Why
See SG-42871 for full context. This covers the mismatch case where new SGD (LGPL PySide6) runs with an old tk-desktop that still has hardcoded, stale PySide version strings in the Licenses dialog.
Compatibility
get_pyside_license_htmland does nothing. tk-desktop handles it natively.Cleanup note
When the long-term solution (SG-30385) is implemented, this patch should be removed - by that point old tk-desktop builds without
get_pyside_license_htmlwill be rare enough to be an accepted limitation.