Skip to content

SG-30385 Add runtime PySide version detection and LGPL attribution in About Box#215

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

SG-30385 Add runtime PySide version detection and LGPL attribution in About Box#215
julien-lang wants to merge 1 commit intomasterfrom
ticket/SG-42871-qt-lgpl-about-box

Conversation

@julien-lang
Copy link
Copy Markdown
Member

Fixes the Qt license compliance issue in the About box Licenses dialog.

Changes

  • licenses.py: replace static HTML read with get_pyside_license_html() classmethod that detects the installed PySide6/PySide2 version at runtime and injects it into the LBP-approved LGPL boilerplate. Add get_license_html() classmethod combining the static base with the dynamic attribution. Both methods are intentionally overridable (see companion PR in tk-framework-desktopstartup).
  • licenses.html: remove the three hardcoded PySide sections (v5.15.0, v6.2.1, v6.5.3) - now generated dynamically.

Why

See SG-42871 for full context. Short version: the About box had hardcoded PySide version strings that were stale and showed outdated Qt attribution regardless of what SGD actually ships. This is a compliance concern.

Compatibility

This is Part 1 of a two-part fix. New tk-desktop handles LGPL attribution itself via runtime detection. The companion PR in tk-framework-desktopstartup (Part 2) covers the case where a new SGD runs with an old tk-desktop that does not yet have this fix.

…tection

Replace hardcoded PySide2/PySide6 version strings in the Licenses dialog
with a dynamically generated LGPL attribution block that detects the
actually installed PySide version at runtime.

Changes:
- licenses.py: add get_pyside_license_html() classmethod that imports PySide
  at runtime and fills the LBP-approved Qt LGPL wording with the real version.
  Add get_license_html() classmethod that combines the static base HTML with
  the dynamic attribution. __init__ now calls get_license_html() instead of
  reading the file directly. Both classmethods are intentionally overridable
  to allow tk-framework-desktopstartup to inject the correct version on older
  tk-desktop builds (see SG-42871 compatibility shim in desktopstartup).
- licenses.html: remove the three hardcoded PySide2/PySide6 sections
  (v5.15.0, v6.2.1, v6.5.3). These are now generated dynamically.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.98%. Comparing base (182f69f) to head (ab16e42).

Files with missing lines Patch % Lines
python/tk_desktop/licenses.py 0.00% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #215      +/-   ##
==========================================
- Coverage   20.08%   19.98%   -0.11%     
==========================================
  Files          69       69              
  Lines        4789     4814      +25     
==========================================
  Hits          962      962              
- Misses       3827     3852      +25     
Flag Coverage Δ
Linux 19.27% <0.00%> (-0.11%) ⬇️
Python-3.10 19.92% <0.00%> (-0.11%) ⬇️
Python-3.11 19.92% <0.00%> (-0.11%) ⬇️
Python-3.13 19.94% <0.00%> (-0.11%) ⬇️
Python-3.9 19.92% <0.00%> (-0.11%) ⬇️
Windows 19.46% <0.00%> (-0.11%) ⬇️
macOS 19.50% <0.00%> (-0.11%) ⬇️

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 Update Qt/PySide license attribution to LGPL with runtime detection SG-30385 Add runtime PySide version detection and LGPL attribution in About Box 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