Skip to content

SG-30385 Add Qt LGPL license compatibility shim for older tk-desktop builds#155

Draft
julien-lang wants to merge 1 commit intomasterfrom
ticket/SG-42871-qt-lgpl-about-box
Draft

SG-30385 Add Qt LGPL license compatibility shim for older tk-desktop builds#155
julien-lang wants to merge 1 commit intomasterfrom
ticket/SG-42871-qt-lgpl-about-box

Conversation

@julien-lang
Copy link
Copy Markdown
Member

Compatibility shim for the Qt LGPL license fix in tk-desktop (SG-42871).

Changes

  • startup.py: add _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 (no get_pyside_license_html method), the function monkey-patches Licenses.__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

  • New SGD + new tk-desktop: patch detects get_pyside_license_html and does nothing. tk-desktop handles it natively.
  • New SGD + old tk-desktop: patch activates and replaces the license HTML.
  • Old SGD + any tk-desktop: this code is not present, tk-desktop handles it via Part 1.

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_html will be rare enough to be an accepted limitation.

…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
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.70%. Comparing base (c168f7b) to head (5b76a0f).

Files with missing lines Patch % Lines
python/shotgun_desktop/startup.py 0.00% 36 Missing ⚠️
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     
Flag Coverage Δ
Linux 9.38% <0.00%> (-0.59%) ⬇️
Python-3.10 9.70% <0.00%> (-0.61%) ⬇️
Python-3.11 9.70% <0.00%> (-0.61%) ⬇️
Python-3.13 9.70% <0.00%> (-0.61%) ⬇️
Python-3.9 9.70% <0.00%> (-0.61%) ⬇️
Windows 9.22% <0.00%> (-0.58%) ⬇️
macOS 9.06% <0.00%> (-0.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@julien-lang julien-lang changed the title SG-42871 Add Qt LGPL license compatibility shim for older tk-desktop builds SG-30385 Add Qt LGPL license compatibility shim for older tk-desktop builds Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant