Skip to content

[patched-9] Port to Qt6, update for C++17/20, and improve compiler/platform support #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 339 commits into
base: patched-9
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
339 commits
Select commit Hold shift + click to select a range
93dcba0
Qt6: qSort and qStableSort removed (#117)
jbowler Oct 4, 2023
0359fd4
Qt6: qSort, toList and fromList removal (#118)
jbowler Oct 5, 2023
72239a3
Qt6: QString::SkipEmptyParts moved to Qt (#119)
jbowler Oct 5, 2023
d11fc4f
Qt6: QTextStream compatibility (#120)
jbowler Oct 5, 2023
b454669
Eliminate warnings about #warning (#122)
jbowler Oct 9, 2023
2779d8a
Qt6: generator/typesystem.cpp: XML workround (#123)
jbowler Oct 9, 2023
42d5084
Add constexpr and decltype parsing (#125)
jbowler Oct 11, 2023
c69ade6
Handle constexpr, auto (#126)
jbowler Oct 12, 2023
0049038
Qt6: fixes for removal of Qt5 types (#127)
jbowler Oct 13, 2023
84233c7
Fix problems in Qt5.11 generator (#128)
jbowler Oct 14, 2023
1fca58b
Use spaces instead of tabs (#129)
jbowler Oct 14, 2023
69635a0
generator: remove anonymous structs (#121)
jbowler Oct 15, 2023
8e57588
generator: call Reporthandler::setContext more (#131)
jbowler Oct 16, 2023
941948e
generator: AbstractMetaClassList: correct sorting (#132)
jbowler Oct 17, 2023
1162164
generator: fix iterator issues with Qt5.14 headers (#142)
jbowler Nov 3, 2023
97038fd
Make sure the ubuntu artifacts do not overwrite each other
mrbean-bremen Nov 3, 2023
c2f63ae
add option to print parser errors when they occur
usiems Nov 3, 2023
5f3bd64
Keep track of current source code in Debug mode,
usiems Nov 3, 2023
c09d033
always ignore .vs folder
usiems Nov 4, 2023
6d90f6c
Add sanitizers
YuriUfimtsev Nov 9, 2023
9259d27
Add a token consistency check between enum and array
YuriUfimtsev Nov 9, 2023
f883917
Reduce memory leaks by implementing the AbstractMetaBuilder destructor
YuriUfimtsev Nov 11, 2023
9337497
Don't interpret "= default" or "= delete" to mean this is an abstract…
usiems Nov 3, 2023
244e0d8
Deleted methods need to marked as "invalid" to be handled correctly
usiems Nov 6, 2023
c31bf7f
Cover cases where noexcept comes with an expression
usiems Nov 4, 2023
98d943b
Implement and use Parser::skipFunctionBody
usiems Nov 3, 2023
73fe34c
Simplify skipFunctionBody by only looking at curly braces
usiems Nov 9, 2023
4fd7848
Avoid currently unsupported use of "noexcept(...)"
usiems Nov 3, 2023
fa2900f
Ignore some more macros that lead to parser errors
usiems Nov 4, 2023
54eccd3
Support basic new-style initializers
usiems Nov 4, 2023
f5b4717
Add missing enum used as default value for a method
usiems Nov 6, 2023
3b38033
Automatically mark methods with r-value references (&&) as invalid
usiems Nov 6, 2023
6f3c979
Don't create wrappers for cbegin and cend
usiems Nov 8, 2023
0f47264
Hopefully make generator immune against iterator order changes for ty…
usiems Nov 8, 2023
4e04d5d
Don't generate wrappers for templated methods in non-template classes
usiems Nov 8, 2023
9fea55f
Fix handling of right-shift as template bracket
mrbean-bremen Nov 1, 2023
13dcd8e
Ignore variadic template parameters
mrbean-bremen Nov 1, 2023
943fa0a
Handle ellipsis in type parser
usiems Nov 9, 2023
0f337ba
Fix: AbstractMetaBuilder::classesTopologicalSorted (#148)
jbowler Nov 10, 2023
ebe2d91
Improve debugging code for rewind, also show identifiers
usiems Nov 10, 2023
d30c3fe
Add qsizetype and qptrdiff as primitive types
usiems Nov 15, 2023
9172e0f
Avoid crash if supposed property setter has no arguments
usiems Nov 14, 2023
4ae718a
Avoid crash in lexer by increasing size of token_stream early
usiems Nov 14, 2023
099eb92
Make number of classes per generated file configurable
usiems Nov 17, 2023
f15effe
Add workflow using generated code (#151)
YuriUfimtsev Nov 17, 2023
eab1136
Make sure uploaded wrapper names are different
mrbean-bremen Nov 18, 2023
480768a
Add version qualifiers to typesystem XML files
usiems Nov 16, 2023
e6591b2
Don't assume some Qt version if it could not be found/parsed
usiems Nov 20, 2023
92fc2d4
Fix workflow for MacOS
usiems Nov 20, 2023
4251c9d
Add Dependabot for GH actions
iakov Nov 18, 2023
1576ba9
Bump actions/checkout from 3 to 4 (#158)
dependabot[bot] Nov 21, 2023
c1881d4
Correct initialization of return value pointer failed
usiems Nov 24, 2023
8545458
Some types are aliases in Qt6 now
usiems Nov 24, 2023
2c64b1d
Comparison rules of QVariant have changed in Qt6
usiems Nov 24, 2023
a5f20ab
Better handling of "auto" and trailing return types "-> decltype()"
usiems Nov 10, 2023
8f10de3
Better handling of variadic templates
usiems Nov 10, 2023
a6baceb
Skip attribute specifiers like [[maybe_unused]]
usiems Nov 10, 2023
4965570
Fix types being rejected because they contain "constexpr"
usiems Nov 13, 2023
d13c281
Handle "friend" functions with implementation body...
usiems Nov 13, 2023
d846b1f
Treat constexpr as a function modifier, not as a type modifier
usiems Nov 14, 2023
81e8c7a
Treat noexcept inside of expressions
usiems Nov 14, 2023
8df305f
Fix expansion of variadic macros in preprocessor
usiems Nov 14, 2023
356e8ac
Fix handling of elif in preprocessor...
usiems Nov 14, 2023
9292768
Support for new-style initializers in expressions
usiems Nov 15, 2023
8c4d63b
Improve handling of new-style initializers
usiems Nov 14, 2023
ea43cc8
Improve type name handling
usiems Nov 14, 2023
645e98f
Make parsing more robust against shuffling of qualifiers/specifiers
usiems Nov 14, 2023
e5c6423
Fix missing includes for namespace items from different files
usiems Nov 14, 2023
690c1cc
Implement methods with lvalue/rvalue references, ...
usiems Nov 15, 2023
63d2603
Handle (templated) functions with packed parameters
usiems Nov 15, 2023
44f7872
Parse inline namespaces,
usiems Nov 17, 2023
04f2ee6
Parse string literal operator definition,
usiems Nov 17, 2023
6041f05
Some necessary defines for Qt6
usiems Nov 15, 2023
303e53b
Add some entries to typesystem files missing for Qt6
usiems Nov 15, 2023
1e2da90
Add new multimedia classes
usiems Nov 17, 2023
e1e85a2
Automatically add enums marked with Q_ENUM to TypeDatabase
usiems Nov 17, 2023
e06ac98
Fix uninitialized member
usiems Nov 20, 2023
97f79c2
Some more defines we don't need to parse
usiems Nov 20, 2023
eca4f5c
Q_PROPERTY might contain "REVISION(1, 1)"
usiems Nov 20, 2023
c0dcb99
Improve parsing of Q_PROPERTY types starting with "const"
usiems Nov 20, 2023
61c6557
Rename "after-version" attribute to "since-version"
usiems Nov 20, 2023
b059614
More missing or updated type entries
usiems Nov 20, 2023
07057fc
Also try to build against Qt 6.5
usiems Nov 20, 2023
c707bcc
Handle enum classes
usiems Nov 21, 2023
f88bbbb
Complete/fix scope for enum class values
usiems Nov 21, 2023
4c61ee7
Remove figureOutEnumValues and company
usiems Nov 21, 2023
f6f00fe
Do not add copy constructor if it was deleted or private
usiems Nov 22, 2023
2b6f1ce
QMutexLocker is a template now, don't know how to handle this
usiems Nov 22, 2023
65f9210
Fix handling of protected operators
usiems Nov 22, 2023
0eda5bf
Fix compiler warning (possibly unintended copy)
usiems Nov 22, 2023
051d222
Fix QList::swap missing the template argument in the argument type
usiems Nov 22, 2023
c421c83
I believe it is not necessary to create a shell for QPagedPaintDevice
usiems Nov 22, 2023
0ed126d
Try to fix library names and linking problems
usiems Nov 22, 2023
652a1fa
Make PythonQtTests compile with Qt6
usiems Nov 23, 2023
19cc4c2
Do not prepend enum class name for items of enum classes,
usiems Nov 23, 2023
6f81c9a
Avoid emitting QStringList* arguments as QStringList<QString>*
usiems Nov 24, 2023
84976a0
Avoid some compiler warnings
usiems Nov 24, 2023
9674bee
Skip alignas specifier
usiems Nov 24, 2023
d75864b
Enable multi-processor compilation for Visual Studio
usiems Dec 8, 2023
e56ceda
Also enable the XML modules in QtAll project
usiems Dec 8, 2023
8769ef4
Handle QStringView et al as argument/return value
usiems Dec 8, 2023
2d72bc5
Filter out methods that do the same (at least in Python)
usiems Dec 8, 2023
467d3c0
Add missing classes
usiems Dec 8, 2023
c9cc51f
webenginewidgets were not compiled yet
usiems Dec 11, 2023
c35d010
Add "enum class" values to the enum type in Python
usiems Dec 8, 2023
77eba42
Escape reserved names by adding "_"
usiems Dec 8, 2023
cb8b1a3
Add Windows to CI for checking generated sources
mrbean-bremen Nov 26, 2023
cfb522b
Unset INCLUDE env var
mrbean-bremen Dec 12, 2023
c7a13c6
Add QtOpenGLWidgets to masterinclude
mrbean-bremen Dec 12, 2023
e132d96
Support QByteArrayView arguments + return values
usiems Dec 12, 2023
af3d2ee
Suppress some methods of QByteArray and others...
usiems Dec 12, 2023
6b87553
Fix misspelled attribute name
usiems Dec 12, 2023
5a3506a
Minor documentation updates
mrbean-bremen Dec 13, 2023
47a0cf4
Move implementation from main.h into main.cpp
mrbean-bremen Dec 13, 2023
d0ddad6
Replace INCLUDE by PYTHONQT_INCLUDE env var
mrbean-bremen Dec 13, 2023
249e092
More typesystem entries (added classes and rejections)
usiems Dec 14, 2023
4e6f13a
Fix irritatingly wrong version number for Qt6
usiems Dec 14, 2023
e83dbed
Fix potential crash for unknown inner type
mrbean-bremen Dec 15, 2023
8c371c0
Register container classes with bool
mrbean-bremen Dec 15, 2023
182df8d
Remove work-around for package spelling
usiems Dec 15, 2023
e9197ec
Create a global namespace wrapper for each package if required
usiems Dec 15, 2023
d059d72
Add enum values to the enum type object itself in any case...
usiems Dec 20, 2023
bf9432e
Small documentation updates
usiems Dec 20, 2023
7aceb48
Bump actions/upload-artifact from 3 to 4 (#181)
dependabot[bot] Jan 2, 2024
34b4521
Bump actions/setup-python from 4 to 5 (#182)
dependabot[bot] Jan 2, 2024
e628aaf
Bump egor-tensin/cleanup-path from 3 to 4
dependabot[bot] Feb 1, 2024
d643ad1
Add generated bindings for Qt 5.15
usiems Jan 30, 2024
52d74fe
On Ubuntu 22.04 this enum value does not exist (yet)
usiems Jan 31, 2024
9a464f0
Ignore static_assert in header files
usiems Feb 27, 2024
8fd43aa
Also register std::pair with the generator
usiems Feb 27, 2024
503ec19
Replace deprecated include qsql.h with qtsqlglobal.h for Qt 6
usiems Mar 7, 2024
3cc771c
fix format-security
nim65s Mar 12, 2024
fc509e6
Force C++11 for older Qt versions, safe/useless for 5.7+
iakov Feb 5, 2024
c43e264
Better reference management pattern
iakov Feb 5, 2024
88b139a
Add PYTHONDEVMODE to improve tests
iakov Feb 6, 2024
f453d06
Add memory deallocation operators
YuriUfimtsev Dec 16, 2023
c009005
Add type copying when creating a getter to correct memory deallocation
YuriUfimtsev Dec 16, 2023
dac269f
Change pointers to QShared pointers to decrease memory leaks
YuriUfimtsev Dec 16, 2023
c776da7
Refactor: change casts and remove toItem() to make it compatible with…
YuriUfimtsev Dec 16, 2023
1286d46
Remove obsolete things; change type to auto
YuriUfimtsev Dec 31, 2023
4da3fd8
Add more shared pointers; remove AbstractMetaType::copy; remove some …
YuriUfimtsev Dec 31, 2023
46d7e6e
Cleanup
YuriUfimtsev Jan 1, 2024
5735ca7
Revert copy method
YuriUfimtsev Feb 4, 2024
16da4f9
6.6.3 introduced a new helper class for QOperatingSystemVersion
usiems Apr 15, 2024
0e1ebc4
fix format-security on Q_OS_MAC
nim65s Apr 16, 2024
b780341
clean more qWarnings()
nim65s Apr 16, 2024
00eb167
Update generator/main.cpp
nim65s Apr 17, 2024
32e1c51
Allow to set and get the render API in QQuickWindow
usiems Apr 30, 2024
14ec00c
Add QVersionNumber to generated code
mrbean-bremen May 3, 2024
12c6c91
Fix tests
iakov Mar 29, 2024
c3d7220
Fix build with PYTHONQT_DEBUG enabled
iakov Mar 29, 2024
1c6cb9f
Improve PYTHONQTALL_CONFIG env var handling for CMD (#214)
iakov May 8, 2024
fd3a033
Remove duplicate entry in build.yml
iakov May 14, 2024
8694332
QPixmapCache::find(QString, QPixmap*) was suppressed
usiems May 29, 2024
4ba9362
Update install-qt-action to v4
iakov Jun 2, 2024
39c414e
Update install-qt-action for Win and Mac builds
iakov Jun 2, 2024
4545da5
Add support for Qt 6.7
mrbean-bremen Jun 20, 2024
ecf1e43
Fix a problem with character after comment always added to macro defi…
usiems Jun 26, 2024
ba22737
Fix comma being dropped from macro varargs argument
usiems Jun 26, 2024
aa0a8e9
Also move friend function definitions to top-level scope if...
usiems Jun 26, 2024
c8b3ed0
Skip attributes that can occur after the enum identifier
usiems Jun 26, 2024
0e69eaa
Also translate standalone unary operators (like -, !, or ~)
usiems Jun 26, 2024
2e9251f
Support for unary + in PythonQt itself
usiems Jun 27, 2024
739f14a
Qt 6.7 introduced macros to define comparison operators
usiems Jun 26, 2024
f70300e
Qt sometimes uses the Qt::Disambiguated_t parameter (with a default v…
usiems Jun 26, 2024
667368f
decltype can contain a comma-expression
usiems Jun 26, 2024
8fa8a8f
Correctly parse string literals with a prefix (e.g. raw string: R"...")
usiems Jun 26, 2024
b530eb5
Ignore Q_GADGET_EXPORT for now, it doesn't help us
usiems Jun 26, 2024
ecd5ea6
Check that externally defined operators are not added twice
usiems Jun 26, 2024
bf1219a
Handle new classes and enums in Qt 6.7
usiems Jun 26, 2024
5f59734
Introduce alias names for types
usiems Jun 27, 2024
59cc67e
Fix nullptr crash in error message
usiems Jun 27, 2024
1b6d329
Better diagnostic output
usiems Jun 27, 2024
c779454
Check for duplicates at one more place
usiems Jun 28, 2024
5331f00
Change centos archive repository and add node16 support
MinyazevR Aug 8, 2024
c36cc0a
Fix memory leak and add memory tests
MinyazevR Aug 9, 2024
15e72e5
Add memory tests with detect_leaks=1 to CI
MinyazevR Aug 9, 2024
9b42537
Fix issue with handling QT_VERSION in build.yml
MinyazevR Aug 9, 2024
093941f
Change PY_VERSION_HEX for use PyConfig
MinyazevR Aug 9, 2024
7a7d90f
Fix big with LSan suppresion
MinyazevR Aug 9, 2024
9d56817
Add ccache to CI
MinyazevR Aug 16, 2024
c9d281f
Fix memory leak with PyDict_Copy
MinyazevR Aug 27, 2024
e2bdefa
Add detailed build instructions to Readme (#235)
tonka3000 Sep 19, 2024
fe8bbe3
Remove use of 'OriginalName' option from code generator...
usiems Oct 2, 2024
cf8998b
Filter away static operators in namespaces
usiems Oct 2, 2024
7a8a2fe
reintroduce the runJavaScript method on QWebEnginePage for Qt 6
usiems Oct 2, 2024
8e5581b
Use latest macOS for CI
mrbean-bremen Oct 20, 2024
39ef1f0
Fix build with Python 3.13 (#246)
FabioLolix Dec 28, 2024
afcbc9c
Remove no longer supported CentOS 7 builds
mrbean-bremen Dec 30, 2024
53415c3
Bump actions/upload-artifact from 3 to 4
dependabot[bot] Feb 1, 2024
55c815a
Bump hendrikmuhs/ccache-action from 1.2.14 to 1.2.16
dependabot[bot] Feb 1, 2025
0458b94
Replace preprocessor with code from simplecpp project
usiems Feb 5, 2025
4e31f1b
Set /bigobj option for Visual Studio
usiems Feb 5, 2025
605dc1a
Adjustments for new stuff in Qt 6.8
usiems Feb 10, 2025
e6453f8
CI: Generate wrappers for Qt 6.8
usiems Feb 5, 2025
92f500f
Replace ubuntu 20.04 with ubuntu 24.04
mrbean-bremen Feb 11, 2025
8f7e5f3
Bump hendrikmuhs/ccache-action from 1.2.16 to 1.2.17
dependabot[bot] Mar 1, 2025
603d142
Update README.md
SchrodingersGat Mar 18, 2025
1df53d2
Update README.md
SchrodingersGat Mar 18, 2025
cb10af0
Fix that registered classes are not added to the designated package
usiems Apr 30, 2025
a6cbba2
Bump hendrikmuhs/ccache-action from 1.2.17 to 1.2.18
dependabot[bot] May 1, 2025
efb3f7c
Fix conversion of large integers to quint64
usiems May 23, 2025
89c03c9
Fix PythonQt build under Qt 6.9
mrbean-bremen Jun 10, 2025
a268782
Use Py_REFCNT instead of ob_refcnt in generated code
mrbean-bremen Jun 13, 2025
bf0ff9e
ENH: add CMake build system support and update CI
Nov 26, 2024
f1df0ec
DOC: Add documentation for installing Qt6
hjmjohnson Jun 25, 2025
a9c14ab
PERF: Don't create temporary QRegularExpression
hjmjohnson Jun 25, 2025
3a2482d
BUG: Logic bug in contenating strings.
hjmjohnson Jun 25, 2025
2d950c7
COMP: Remove use of deprecated 'count()' function
hjmjohnson Jun 25, 2025
251544a
BUG: Fix PyUnicode/PyString usage for Qt6 compatibility
hjmjohnson Jun 25, 2025
f0c4ee6
REF: Replace Q_FOREACH with range-based for loops
hjmjohnson Jun 26, 2025
b80788b
ENH: If not set, choose Release BUILD_TYPE
hjmjohnson Jun 25, 2025
f280ece
ENH: Remove QT5 modules from Qt6 QTMODULES
hjmjohnson Jun 25, 2025
e487347
BUG: Remove deprecated Qt6 paradigms
hjmjohnson Jun 25, 2025
78687fb
ENH: Set old QT_VERSION_* variables.
hjmjohnson Jun 25, 2025
7e51b05
ENH: Add src to default include directories for PythonQt.h
hjmjohnson Jun 25, 2025
2fde0d7
ENH: Improve Qt include path resolution macOS
hjmjohnson Jun 26, 2025
317240f
ENH: Removing obsolete python2 support
hjmjohnson Jun 26, 2025
e388ac3
REF: Remove outdated `PY_VERSION_HEX` conditional branches
hjmjohnson Jun 26, 2025
aadc998
ENH: Define environment variables for Python and Qt versions in CMake
hjmjohnson Jun 26, 2025
5b1bf63
ENH: Update CMake to exclude qtscript_masterinclude.h and improve Qt5…
hjmjohnson Jun 26, 2025
8d5e204
ENH: Improve Qt include directory detection in generator CMake
hjmjohnson Jun 26, 2025
f23f420
ENH: Add file existence and readability checks for generator inputs
hjmjohnson Jun 26, 2025
ab78685
ENH: Add Qt6-specific build_all file and update generator resource ha…
hjmjohnson Jun 26, 2025
fad2ce8
ENH: Simplify Qt version handling in CMake and consolidate component …
hjmjohnson Jun 26, 2025
eaadef3
ENH: Add directory existence and readability checks for include paths…
hjmjohnson Jun 26, 2025
bc9a2c8
ENH: Add debug output for object tree dumping in generator
hjmjohnson Jun 26, 2025
11c251a
ENH: Add compile definitions to enforce safer casting rules in CMake
hjmjohnson Jun 26, 2025
bbd2ed8
ENH: Refactor CMakeLists to explicitly define public headers and sour…
hjmjohnson Jun 26, 2025
261ae9b
ENH: Enhance Qt6 include directory resolution
hjmjohnson Jun 26, 2025
986707e
ENH: Update generated path in CMake to include Qt version-specific su…
hjmjohnson Jun 26, 2025
a5b65ea
ENH: Refine Qt6 include path resolution for macOS framework support
hjmjohnson Jun 26, 2025
0f1618c
BUG: Fix generated path handling in CMake to remove incorrect version…
hjmjohnson Jun 26, 2025
8ab4791
BUG: Unsupported combination headers caused build error
hjmjohnson Jun 26, 2025
da40492
REF: Replace `qAsConst` with `std::as_const` for C++17 compatibility
hjmjohnson Jun 27, 2025
e886394
REF: Replace `QVariant::Type` with `QMetaType::Type` for Qt compatibi…
hjmjohnson Jun 27, 2025
005d4b6
REF: Update verbose/optimize flag handling for Python 3.11 compatibility
hjmjohnson Jun 27, 2025
48dd28f
ENH: Disable deprecated Qt features prior to version 6 in generator
hjmjohnson Jun 27, 2025
5c189da
ENH: Propogate macro from Python3.12
hjmjohnson Jun 28, 2025
abab7cf
WIP: Remove old generated files
hjmjohnson Jun 27, 2025
2fa9c2c
WIP: Comment out items not needed for Slicer
hjmjohnson Jun 29, 2025
79b7be9
ENH: Add BUILD_EXTENSIONS, BUILD_TESTING, BUILD_EXAMPLES options.
hjmjohnson Jun 27, 2025
2078cd4
COMP: The installed package should be named PythonQt
hjmjohnson Jun 27, 2025
7167e1a
ENH: Add configure package options for PythonQt
hjmjohnson Jun 27, 2025
c6b98d4
ENH: Install all public headers in target.
hjmjohnson Jun 29, 2025
707c1c2
COMP: Need to install all the PythonQt headers.
hjmjohnson Jun 29, 2025
e1b00df
COMP: Add PythonQt_QtBindings.cpp form patch-9 branch.
hjmjohnson Jun 29, 2025
2c6f7fc
COMP: Backport from patch-9 slicer
hjmjohnson Jun 29, 2025
c9a6302
ENH: Add compatibility for Python 3.13 hashing with fallbacks for old…
hjmjohnson Jun 29, 2025
d809165
COMP: Remove _Py_HashPointer as undefined symbol.
hjmjohnson Jun 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
360 changes: 360 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,360 @@
name: Build

on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
ubuntu:
strategy:
fail-fast: false
matrix:
container_version:
- '22.04'
- '24.04'
runs-on: ubuntu-latest
container: ubuntu:${{ matrix.container_version }}
steps:
- name: Install Qt
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \
build-essential \
python3 \
python3-dev \
libpython3-dev \
qtbase5-dev \
qtbase5-private-dev \
qt5-qmake \
qtbase5-dev-tools \
qttools5-dev \
qtdeclarative5-dev \
libqt5svg5* \
libqt5xmlpatterns5* \
libqt5multimedia5* \
libqt5multimediawidgets5* \
libqt5qml5* \
libqt5quickwidgets5* \
qtmultimedia5-dev
apt-get clean

- name: Checkout PythonQt
uses: actions/checkout@v4

- name: Ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-ubuntu-${{ matrix.container_version }}

- name: Build PythonQt
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version
echo ============================
qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \
CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
make -j $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"

- name: Run memory tests with sanitizers
run: |
QT_VERSION_FULL=$(qmake -query QT_VERSION)
if [[ "$QT_VERSION_FULL" == 5.12* ]]; then
echo "leak:QPlatformIntegrationFactory::create" >> $PWD/lsan.supp
export LSAN_OPTIONS="suppressions=$PWD/lsan.supp"
fi
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
PYTHONQT_RUN_ONLY_MEMORY_TESTS=1 \
make check TESTARGS="-platform minimal"

- name: Generate Wrappers
run: |
# workaround to allow to find the Qt include dirs for installed standard qt packages
mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include
export QTDIR=/usr/include/qt5
cd generator
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./pythonqt_generator

- name: Upload Wrappers
uses: actions/upload-artifact@v4
with:
name: wrappers_ubuntu_${{ matrix.container_version }}
path: generated_cpp

oldschool:
strategy:
fail-fast: false
matrix:
container_os: ['rockylinux']
container_os_version: ['9']
configuration: ['debug', 'release']
runs-on: ubuntu-latest
container: '${{ matrix.container_os }}:${{ matrix.container_os_version }}'
steps:
- name: Install Qt
run: |
yum update -y
yum groupinstall "Development Tools" -y
yum install -y \
which \
python-devel \
qt5-qtbase-* \
qt5-qttools* \
qt5-qtsvg \
qt5-qtxmlpatterns \
qt5-qtmultimedia \
qt5-qt3d \
qt5-*-devel

- name: Checkout PythonQt
uses: actions/checkout@v4

- name: Build PythonQt
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
which python 2>/dev/null && export PYTHON_VERSION_SUFFIX= || export PYTHON_VERSION_SUFFIX=3
uname -a; gcc --version | grep "gcc"; python${PYTHON_VERSION_SUFFIX} --version; qmake-qt5 --version
echo ============================
export PYTHON_VERSION_SHORT=`python${PYTHON_VERSION_SUFFIX} --version | cut -d " " -f 2 | cut -d "." -f1,2`
if [[ `echo ${PYTHON_VERSION_SHORT} | wc -w` = 0 ]]; then export PYTHON_VERSION_SHORT=2.7; fi
export PYTHON_DIR=`which python${PYTHON_VERSION_SUFFIX} | xargs dirname | xargs dirname`
echo PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT}
echo PYTHON_DIR=${PYTHON_DIR}
qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \
"PYTHON_VERSION=${PYTHON_VERSION_SHORT}" "PYTHON_DIR=${PYTHON_DIR}"
make -j $(nproc) && \
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
make check TESTARGS="-platform offscreen"

- name: Generate Wrappers
run: |
# workaround to allow to find the Qt include dirs for installed standard qt packages
mkdir /usr/include/qt5ln; ln -s /usr/include/qt5 /usr/include/qt5ln/include
export QTDIR=/usr/include/qt5ln
cd generator
./pythonqt_generator

- name: Upload Wrappers
uses: actions/upload-artifact@v4
with:
name: wrappers_${{ matrix.container_os }}-${{ matrix.container_os_version }}_${{ matrix.configuration }}
path: generated_cpp

macOS:
strategy:
fail-fast: false
matrix:
macos-version: ['latest']
python-version: ['3.9']
qt-version: ['5.9.*']
configuration: ['release','debug']
include:
- macos-version: 'latest'
python-version: '3.11'
qt-version: '5.12.*'
configuration: 'debug'
runs-on: macos-${{ matrix.macos-version }}
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qtscript'
archives: 'qtmultimedia qtmacextras qtbase qttools'

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'

- name: Checkout PythonQt
uses: actions/checkout@v4

- name: Ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-${{ matrix.qt-version }}

- name: Detect exact versions
id : versions
run : |
set -eu
PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ')
PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL)
QT_VERSION_FULL=$($QT_ROOT_DIR/bin/qmake -query QT_VERSION)
QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL)
MACOS_VERSION_FULL=$(sw_vers -productVersion)
MACOS_VERSION_SHORT=$(cut -f 1,2 -d . <<< $MACOS_VERSION_FULL)

echo "PYTHON_VERSION_FULL=$PYTHON_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "MACOS_VERSION_FULL=$MACOS_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "MACOS_VERSION_SHORT=$MACOS_VERSION_SHORT" | tee -a $GITHUB_OUTPUT

- name: Build PythonQt
run: |
set -ue
echo ======= SYSTEM INFO ========
uname -a; gcc --version | head -n 1; python --version; qmake --version
echo ============================
PYTHON_VERSION_MAJOR=$(cut -d . -f1 <<< ${{ steps.versions.outputs.PYTHON_VERSION_SHORT }})
for i in "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \
"python${PYTHON_VERSION_MAJOR}-embed" "python${PYTHON_VERSION_MAJOR}"
do if pkg-config --exists "$i"; then PYTHON_PKGCONFIG_NAME="$i"; break; fi; done
qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }} \
PYTHON_DIR="$pythonLocation" \
PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \
-r PythonQt.pro
make -j $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"

- name: Generate Wrappers
if: ${{ contains(matrix.configuration, 'release') }}
run: |
cd generator
# workaround to allow to find the Qt include dirs for installed standard qt packages
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
QTDIR=-UNDEFINED- ./pythonqt_generator --qt-version=${{ steps.versions.outputs.QT_VERSION_FULL }} --include-paths=$QT_ROOT_DIR/lib

- name: Upload Wrappers
uses: actions/upload-artifact@v4
with:
name: wrappers_macos${{ steps.versions.outputs.MACOS_VERSION_SHORT }}_qt${{ steps.versions.outputs.QT_VERSION_SHORT }}
path: generated_cpp

windows:
strategy:
fail-fast: false
matrix:
qt-arch: ['win64_mingw73']
python-version: ['3.10']
qt-version: ['5.12.*']
python-arch: ['x64']
pythonqtall-config: ['']
# msvc-toolset: ['14.0']
include:
- qt-arch: 'win64_msvc2017_64'
python-version: '3.6'
python-arch: 'x64'
qt-version: '5.11.*'
# msvc-toolset: '14.16'

- qt-arch: 'win64_msvc2019_64'
python-version: '3.13'
python-arch: 'x64'
qt-version: '5.15.*'
pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia'

- qt-arch: 'win32_mingw53'
python-version: '3.6'
python-arch: 'x86'
qt-version: '5.11.*'

#Either MSVC2015 is sick or Qt5.9 is buggy :(
#Main problem is QBasicMutex with default ctor, that (by no means) is missing in dll-export of QtCore, but linker tries to find it
# - qt-arch: 'win32_msvc2015'
# python-version: '2.7'
# python-arch: 'x86'
# qt-version: '5.9.*'
# pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia'

runs-on: windows-latest
steps:

- name: Checkout PythonQt
uses: actions/checkout@v4

- name: Reset PATH
uses: egor-tensin/cleanup-path@v4

- name: Install MSVC++
uses: ilammy/msvc-dev-cmd@v1
if: ${{ contains(matrix.qt-arch, 'msvc') }}
with:
arch: amd64${{ contains(matrix.python-arch, 'x86') && '_x86' || '' }}

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
host: 'windows'
target: 'desktop'
arch: ${{ matrix.qt-arch }}
modules: 'qtscript'
archives: 'qtwinextras qtmultimedia qtbase'
tools: ${{ contains(matrix.qt-arch, 'mingw') && format('tools_mingw,qt.tools.{0}0', matrix.qt-arch) || '' }}

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python-version }}'
architecture: ${{ matrix.python-arch }}

- name: Detect exact versions
shell: bash
id: versions
run: |
set -eu
QT_VERSION_FULL=$("$QT_ROOT_DIR/bin/qmake" -query QT_VERSION)
QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL)
PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ')
PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL)
echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT

- name: Build PythonQt
shell: cmd
run: |
qmake -query
python --version
set PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
"PYTHON_PATH=%pythonLocation%" ^
"PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" ^
PythonQt.pro
set PYTHONDEVMODE=1
set PYTHONASYNCIODEBUG=1
set PYTHONWARNINGS=error
mingw32-make -j 2 && mingw32-make check "TESTARGS=-platform offscreen" ^
|| set CL=/MP && nmake && nmake check "TESTARGS=-platform offscreen"

- name: Generate Wrappers
shell: cmd
run: |
cd generator
set QTDIR=%QT_ROOT_DIR%
pythonqt_generator

- name: Upload Wrappers
if: (matrix.pythonqtall-config || '') == ''
uses: actions/upload-artifact@v4
with:
name: wrappers_${{ matrix.qt-arch }}_${{ steps.versions.outputs.QT_VERSION_SHORT }}
path: generated_cpp
Loading