aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-06-29 15:19:20 +0300
committerSimo Fält <simo.falt@qt.io>2023-06-29 15:19:20 +0300
commit568797c36a73aecce050fd198353f31aa986bff9 (patch)
treee1781afe922c4b6327045134639a5c5d41b56300
parent643237181d15086816d38cdb17f18147c7ebcbd8 (diff)
parentc76c68a64bb4dce48017c61b4ca021dc6726f77b (diff)
Merge tag 'v5.15.11-lts' into tqtc/lts-5.15-opensourcev5.15.11-lts-lgpl
Qt For Python Release 5.15.11 Change-Id: Idbf9b792238244e185e39be4058a7a2c69458ce9
-rw-r--r--build_scripts/config.py1
-rw-r--r--build_scripts/utils.py6
-rw-r--r--build_scripts/wheel_override.py31
-rw-r--r--coin/dependencies.yaml2
-rw-r--r--dist/changes-5.15.1126
-rw-r--r--requirements.txt1
-rw-r--r--sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml14
-rw-r--r--sources/pyside2/PySide2/QtGui/CMakeLists.txt2
-rw-r--r--sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt2
-rw-r--r--sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml8
-rw-r--r--sources/pyside2/PySide2/support/generate_pyi.py15
-rw-r--r--sources/pyside2/doc/gettingstarted-linux.rst6
-rw-r--r--sources/pyside2/doc/gettingstarted-macOS.rst6
-rw-r--r--sources/pyside2/doc/gettingstarted-windows.rst4
-rw-r--r--sources/pyside2/libpyside/pysideproperty.cpp2
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp5
-rw-r--r--sources/pyside2/libpyside/pysidesignal.cpp5
-rw-r--r--sources/pyside2/libpyside/pysideweakref.cpp9
-rw-r--r--sources/pyside2/pyside_version.py2
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp20
-rw-r--r--sources/shiboken2/doc/typesystem_specifying_types.rst13
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp16
-rw-r--r--sources/shiboken2/libshiboken/sbkenum.cpp13
-rw-r--r--sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp5
-rw-r--r--sources/shiboken2/libshiboken/sbkstring.cpp19
-rw-r--r--sources/shiboken2/shiboken_version.py2
-rw-r--r--sources/shiboken2/shibokenmodule/CMakeLists.txt8
-rw-r--r--sources/shiboken2/shibokenmodule/Shiboken.pyi54
-rw-r--r--sources/shiboken2/shibokenmodule/py.typed.in1
29 files changed, 230 insertions, 68 deletions
diff --git a/build_scripts/config.py b/build_scripts/config.py
index 00cbd3fc9..9bb4c6495 100644
--- a/build_scripts/config.py
+++ b/build_scripts/config.py
@@ -94,6 +94,7 @@ class Config(object):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11'
]
self.setup_script_dir = None
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 49839e2de..dafd3f362 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -64,6 +64,10 @@ except NameError:
WindowsError = None
+def is_64bit():
+ return sys.maxsize > 2147483647
+
+
def filter_match(name, patterns):
for pattern in patterns:
if pattern is None:
@@ -1242,4 +1246,4 @@ def provisioning():
print("debug: Exception error: {}".format(e))
file = file.replace("s://download","://master")
print("New url: {}".format(file))
- download_and_extract_7z(file, target) \ No newline at end of file
+ download_and_extract_7z(file, target)
diff --git a/build_scripts/wheel_override.py b/build_scripts/wheel_override.py
index 3f3c12a2e..ba4f5b11e 100644
--- a/build_scripts/wheel_override.py
+++ b/build_scripts/wheel_override.py
@@ -38,14 +38,17 @@
#############################################################################
-wheel_module_exists = False
-
import os
import sys
+import platform
from .options import DistUtilsCommandMixin, OPTION
from distutils import log as logger
from email.generator import Generator
from .wheel_utils import get_package_version, get_qt_version, macos_plat_name
+from .utils import is_64bit
+
+wheel_module_exists = False
+
try:
@@ -86,11 +89,11 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
self.plat_name = macos_plat_name()
# When limited API is requested, notify bdist_wheel to
- # create a properly named package.
- limited_api_enabled = (OPTION["LIMITED_API"] == 'yes'
- and sys.version_info[0] >= 3)
+ # create a properly named package, which will contain
+ # the initial cpython version we support.
+ limited_api_enabled = OPTION["LIMITED_API"] == 'yes'
if limited_api_enabled:
- self.py_limited_api = "cp35.cp36.cp37.cp38.cp39.cp310"
+ self.py_limited_api = "cp36"
self._package_version = get_package_version()
@@ -101,9 +104,9 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
# Slightly modified version of wheel's wheel_dist_name
# method, to add the Qt version as well.
# Example:
- # PySide2-5.6-5.6.4-cp27-cp27m-macosx_10_10_intel.whl
- # The PySide2 version is "5.6".
- # The Qt version built against is "5.6.4".
+ # PySide6-6.3-6.3.2-cp36-abi3-macosx_10_10_intel.whl
+ # The PySide6 version is "6.3".
+ # The Qt version built against is "6.3.2".
wheel_version = "{}-{}".format(self._package_version, get_qt_version())
components = (_safer_name(self.distribution.get_name()), wheel_version)
if self.build_number:
@@ -113,9 +116,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
# Copy of get_tag from bdist_wheel.py, to allow setting a
# multi-python impl tag, by removing an assert. Otherwise we
# would have to rename wheels manually for limited api
- # packages. Also we set "none" abi tag on Windows, because
- # pip does not yet support "abi3" tag, leading to
- # installation failure when tried.
+ # packages.
def get_tag(self):
# bdist sets self.plat_name if unset, we should only use it for purepy
# wheels if the user supplied it.
@@ -136,7 +137,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
# modules, use the default platform name.
plat_name = get_platform(self.bdist_dir)
- if plat_name in ('linux-x86_64', 'linux_x86_64') and sys.maxsize == 2147483647:
+ if plat_name in ('linux-x86_64', 'linux_x86_64') and not is_64bit():
plat_name = 'linux_i686'
# To allow uploading to pypi, we need the wheel name
@@ -157,7 +158,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
if self.root_is_pure:
if self.universal:
- impl = 'py2.py3'
+ impl = 'py3'
else:
impl = self.python_tag
tag = (impl, 'none', plat_name)
@@ -168,7 +169,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin):
# We don't work on CPython 3.1, 3.0.
if self.py_limited_api and (impl_name + impl_ver).startswith('cp3'):
impl = self.py_limited_api
- abi_tag = "abi3" if sys.platform != "win32" else "none"
+ abi_tag = "abi3"
else:
abi_tag = str(get_abi_tag()).lower()
tag = (impl, abi_tag, plat_name)
diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml
index c2e475643..93d33c901 100644
--- a/coin/dependencies.yaml
+++ b/coin/dependencies.yaml
@@ -1,6 +1,6 @@
product_dependency:
../../qt/tqtc-qt5.git:
- ref: "67ee8a740e8a46c7dd470889ac182f465081dd1c"
+ ref: "5bbe0d09c5ec49df334b62ed1b3338bbba5d1981"
dependency_source: supermodule
dependencies: [
"../../qt/qt3d",
diff --git a/dist/changes-5.15.11 b/dist/changes-5.15.11
new file mode 100644
index 000000000..172df845f
--- /dev/null
+++ b/dist/changes-5.15.11
@@ -0,0 +1,26 @@
+Qt for Python 5.5.11 is a bug-fix release.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qtforpython/
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* PySide2 *
+****************************************************************************
+
+ - [PYSIDE-1956] Documentation regarding the clang environment variables has
+ been fixed.
+ - [PYSIDE-1960] Support for Python 3.11 has been added.
+ - [PYSIDE-1980] The GLES build has been fixed.
+ - [PYSIDE-2019] Crashes when using QtDataVisualization's
+ QValue3DAxisFormatter have been fixed.
+ - [PYSIDE-2043] Errors when using VSCode's Intellisense have been fixed.
diff --git a/requirements.txt b/requirements.txt
index 9c25886ec..c4446454b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,6 +4,7 @@ numpy==1.16.6; python_version < '3'
# setuptools from v45+ removed the support for Python 2, so we pin an old release
setuptools==44.0.0; python_version < '3'
setuptools; python_version >= '3'
+packaging
sphinx
six
wheel>=0.35
diff --git a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
index 5dc87a013..1e0219fd0 100644
--- a/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
+++ b/sources/pyside2/PySide2/QtDataVisualization/typesystem_datavisualization.xml
@@ -85,8 +85,20 @@
</object-type>
<object-type name="QCategory3DAxis"/>
<object-type name="QLogValue3DAxisFormatter"/>
- <object-type name="QValue3DAxis"/>
+ <object-type name="QValue3DAxis">
+ <modify-function signature="setFormatter(QValue3DAxisFormatter *)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ </object-type>
<object-type name="QValue3DAxisFormatter">
+ <modify-function signature="createNewInstance() const">
+ <modify-argument index="return">
+ <define-ownership class="native" owner="c++"/>
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ </modify-function>
<modify-function signature="populateCopy(QtDataVisualization::QValue3DAxisFormatter&amp;)const">
<modify-argument index="1">
<parent index="this" action="add"/>
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
index 88d8be93f..38a0c1a50 100644
--- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
@@ -227,7 +227,7 @@ endif()
list(FIND QtGui_enabled_features "opengles2" _opengles2Index)
# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtGui_enabled_features)
if(_opengles2Index GREATER -1)
- list(APPEND QtGui_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery)
+ list(APPEND QtGui_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery QOpenGLVersionFunctionsFactory)
message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Dropping Desktop OpenGL classes (GLES2)")
else()
list(APPEND QtGui_SRC
diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
index 62ed669cc..208e76fac 100644
--- a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
@@ -11,7 +11,7 @@ set(QtOpenGLFunctions_SRC ${QtOpenGLFunctions_GEN_DIR}/qtopenglfunctions_module_
list(FIND QtOpenGLFunctions_enabled_features "opengles2" _opengles2Index)
# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtOpenGLFunctions_enabled_features)
if(_opengles2Index GREATER -1)
- list(APPEND QtOpenGLFunctions_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery)
+ list(APPEND QtOpenGLFunctions_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery QOpenGLVersionFunctionsFactory)
list(APPEND QtOpenGLFunctions_SRC
${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_es2_wrapper.cpp)
message(STATUS "Qt${QT_MAJOR_VERSION}OpenGLFunctions: Dropping Desktop OpenGL classes (GLES2)")
diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
index c20351723..bc71213ee 100644
--- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
@@ -2306,9 +2306,17 @@
</extra-includes>
<modify-function signature="critical(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QMessageBox::StandardButton&gt;,QMessageBox::StandardButton)" allow-thread="yes"/>
+ <modify-function signature="critical(QWidget*,const QString&amp;,const QString&amp;,QMessageBox::StandardButton,QMessageBox::StandardButton)"
+ allow-thread="yes"/>
<modify-function signature="information(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QMessageBox::StandardButton&gt;,QMessageBox::StandardButton)" allow-thread="yes"/>
+ <modify-function signature="information(QWidget*,const QString&amp;,const QString&amp;,QMessageBox::StandardButton,QMessageBox::StandardButton)"
+ allow-thread="yes"/>
<modify-function signature="question(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QMessageBox::StandardButton&gt;,QMessageBox::StandardButton)" allow-thread="yes"/>
+ <modify-function signature="question(QWidget*,const QString&amp;,const QString&amp;,QMessageBox::StandardButton,QMessageBox::StandardButton)"
+ allow-thread="yes"/>
<modify-function signature="warning(QWidget*,const QString&amp;,const QString&amp;,QFlags&lt;QMessageBox::StandardButton&gt;,QMessageBox::StandardButton)" allow-thread="yes"/>
+ <modify-function signature="warning(QWidget*,const QString&amp;,const QString&amp;,QMessageBox::StandardButton,QMessageBox::StandardButton)"
+ allow-thread="yes"/>
<modify-function signature="QMessageBox(const QString&amp;,const QString&amp;,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/>
<modify-function signature="critical(QWidget*,const QString&amp;,const QString&amp;,int,int,int)" remove="all"/>
<modify-function signature="critical(QWidget*,const QString&amp;,const QString&amp;,const QString&amp;,const QString&amp;,const QString&amp;,int,int)" remove="all"/>
diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py
index 9eb84de7a..19565338f 100644
--- a/sources/pyside2/PySide2/support/generate_pyi.py
+++ b/sources/pyside2/PySide2/support/generate_pyi.py
@@ -147,10 +147,7 @@ class Formatter(Writer):
self.print("from PySide2.support.signature.mapping import (")
self.print(" Virtual, Missing, Invalid, Default, Instance)")
self.print()
- self.print("class Object(object): pass")
- self.print()
- self.print("import shiboken2 as Shiboken")
- self.print("Shiboken.Object = Object")
+ self.print("from shiboken2 import Shiboken")
self.print()
# This line will be replaced by the missing imports postprocess.
self.print("IMPORTS")
@@ -222,7 +219,6 @@ def generate_pyi(import_name, outpath, options):
outfile = io.StringIO()
fmt = Formatter(outfile)
fmt.print(LICENSE_TEXT.strip())
- need_imports = not USE_PEP563
if USE_PEP563:
fmt.print("from __future__ import annotations")
fmt.print()
@@ -246,11 +242,10 @@ def generate_pyi(import_name, outpath, options):
line = line.rstrip()
# we remove the IMPORTS marker and insert imports if needed
if line == "IMPORTS":
- if need_imports:
- for mod_name in find_imports(outfile.getvalue()):
- imp = "PySide2." + mod_name
- if imp != import_name:
- wr.print("import " + imp)
+ for mod_name in find_imports(outfile.getvalue()):
+ imp = "PySide2." + mod_name
+ if imp != import_name:
+ wr.print("import " + imp)
wr.print("import " + import_name)
wr.print()
wr.print()
diff --git a/sources/pyside2/doc/gettingstarted-linux.rst b/sources/pyside2/doc/gettingstarted-linux.rst
index 0474d457f..6ce2d1f86 100644
--- a/sources/pyside2/doc/gettingstarted-linux.rst
+++ b/sources/pyside2/doc/gettingstarted-linux.rst
@@ -49,11 +49,11 @@ If you don't have libclang already in your system, you can download from the Qt
wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_100-based-linux-Rhel7.6-gcc5.3-x86_64.7z
-Extract the files, and leave it on any desired path, and then set these two required
-environment variables::
+Extract the files, and leave it on any desired path, and set the environment
+variable required::
7z x libclang-release_100-based-linux-Rhel7.6-gcc5.3-x86_64.7z
- export CLANG_INSTALL_DIR=$PWD/libclang
+ export LLVM_INSTALL_DIR=$PWD/libclang
Getting PySide2
~~~~~~~~~~~~~~~
diff --git a/sources/pyside2/doc/gettingstarted-macOS.rst b/sources/pyside2/doc/gettingstarted-macOS.rst
index fd1bf89f8..b0208ff2c 100644
--- a/sources/pyside2/doc/gettingstarted-macOS.rst
+++ b/sources/pyside2/doc/gettingstarted-macOS.rst
@@ -50,11 +50,11 @@ If you don't have libclang already in your system, you can download from the Qt
wget http://download.qt.io/development_releases/prebuilt/libclang/libclang-release_100-based-mac.7z
-Extract the files, and leave it on any desired path, and then set these two required
-environment variables::
+Extract the files, and leave it on any desired path, and set the environment
+variable required::
7z x libclang-release_100-based-mac.7z
- export CLANG_INSTALL_DIR=$PWD/libclang
+ export LLVM_INSTALL_DIR=$PWD/libclang
Getting PySide2
~~~~~~~~~~~~~~~
diff --git a/sources/pyside2/doc/gettingstarted-windows.rst b/sources/pyside2/doc/gettingstarted-windows.rst
index 069358e0f..442e6f7ed 100644
--- a/sources/pyside2/doc/gettingstarted-windows.rst
+++ b/sources/pyside2/doc/gettingstarted-windows.rst
@@ -59,8 +59,8 @@ Setting up CLANG
If you don't have libclang already in your system, you can download from the Qt servers,
e.g. ``libclang-release_100-based-windows-vs2019_64.7z``.
-Extract the files, and leave it on any desired path, e.g ``c:\``, and then set these two required
-environment variables::
+Extract the files, and leave it on any desired path, for example, ``c:``,
+and set the environment variable required::
set LLVM_INSTALL_DIR=c:\libclang
set PATH=C:\libclang\bin;%PATH%
diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp
index 73d6767dd..0d0957f55 100644
--- a/sources/pyside2/libpyside/pysideproperty.cpp
+++ b/sources/pyside2/libpyside/pysideproperty.cpp
@@ -104,6 +104,7 @@ static PyType_Slot PySidePropertyType_slots[] = {
{Py_tp_init, (void *)qpropertyTpInit},
{Py_tp_new, (void *)qpropertyTpNew},
{Py_tp_getset, PySidePropertyType_getset},
+ {Py_tp_del, reinterpret_cast<void *>(PyObject_GC_Del)},
{0, 0}
};
// Dotted modulename is crucial for SbkType_FromSpec to work. Is this name right?
@@ -249,6 +250,7 @@ static void qpropertyDeAlloc(PyObject *self)
// This was not needed before Python 3.8 (Python issue 35810)
Py_DECREF(Py_TYPE(self));
}
+ PyObject_GC_UnTrack(self);
Py_TYPE(self)->tp_free(self);
}
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index 8b224f2c8..1f64b089d 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -191,8 +191,9 @@ namespace QFlags
SbkNewQFlagsType_slots[idx].pfunc = numberMethods[idx].pfunc;
}
newspec.slots = SbkNewQFlagsType_spec.slots;
- PyTypeObject *type = (PyTypeObject *)SbkType_FromSpec(&newspec);
- Py_TYPE(type) = &PyType_Type;
+ auto *obj = SbkType_FromSpec(&newspec);
+ auto *type = reinterpret_cast<PyTypeObject *>(obj);
+ obj->ob_type = &PyType_Type;
PySideQFlagsType *flagsType = reinterpret_cast<PySideQFlagsType *>(type);
PepType_PFTP(flagsType)->converterPtr = &PepType_PFTP(flagsType)->converter;
diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp
index b5069a00a..607ce163c 100644
--- a/sources/pyside2/libpyside/pysidesignal.cpp
+++ b/sources/pyside2/libpyside/pysidesignal.cpp
@@ -160,9 +160,10 @@ PyTypeObject *PySideSignalTypeF(void)
{
static PyTypeObject *type = nullptr;
if (!type) {
- type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpec(&PySideSignalType_spec));
+ auto *obj = SbkType_FromSpec(&PySideSignalType_spec);
+ type = reinterpret_cast<PyTypeObject *>(obj);
PyTypeObject *hold = Py_TYPE(type);
- Py_TYPE(type) = PySideMetaSignalTypeF();
+ obj->ob_type = PySideMetaSignalTypeF();
Py_INCREF(Py_TYPE(type));
Py_DECREF(hold);
}
diff --git a/sources/pyside2/libpyside/pysideweakref.cpp b/sources/pyside2/libpyside/pysideweakref.cpp
index cd90634bd..707df98f5 100644
--- a/sources/pyside2/libpyside/pysideweakref.cpp
+++ b/sources/pyside2/libpyside/pysideweakref.cpp
@@ -88,10 +88,11 @@ PyObject *create(PyObject *obj, PySideWeakRefFunction func, void *userData)
if (obj == Py_None)
return 0;
- if (Py_TYPE(PySideCallableObjectTypeF()) == 0)
- {
- Py_TYPE(PySideCallableObjectTypeF()) = &PyType_Type;
- PyType_Ready(PySideCallableObjectTypeF());
+ auto *callableObject_Type = PySideCallableObjectTypeF();
+ auto *callableObject_PyObject = reinterpret_cast<PyObject *>(callableObject_Type);
+ if (callableObject_PyObject->ob_type == nullptr) {
+ callableObject_PyObject->ob_type = &PyType_Type;
+ PyType_Ready(callableObject_Type);
}
PyTypeObject *type = PySideCallableObjectTypeF();
diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py
index 80dd16ae0..88792a380 100644
--- a/sources/pyside2/pyside_version.py
+++ b/sources/pyside2/pyside_version.py
@@ -39,7 +39,7 @@
major_version = "5"
minor_version = "15"
-patch_version = "10"
+patch_version = "11"
# For example: "a", "b", "rc"
# (which means "alpha", "beta", "release candidate").
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
index b73670909..ebe3b995a 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
@@ -784,18 +784,22 @@ static bool cStringStartsWith(const char *str, const QByteArray &prefix)
return std::strncmp(prefix.constData(), str, int(prefix.size())) == 0;
}
+#ifdef Q_OS_UNIX
+static bool cStringContains(const char *str, const char *prefix)
+{
+ return std::strstr(str, prefix) != nullptr;
+}
+#endif
+
bool BuilderPrivate::visitHeader(const char *cFileName) const
{
// Resolve OpenGL typedefs although the header is considered a system header.
const char *baseName = cBaseName(cFileName);
if (cCompareFileName(baseName, "gl.h"))
return true;
-#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
- if (cStringStartsWith(cFileName, "/usr/include/stdint.h"))
- return true;
-#endif
#ifdef Q_OS_LINUX
- if (cStringStartsWith(cFileName, "/usr/include/stdlib.h")
+ if (cStringStartsWith(cFileName, "/usr/include/stdint.h")
+ || cStringStartsWith(cFileName, "/usr/include/stdlib.h")
|| cStringStartsWith(cFileName, "/usr/include/sys/types.h")) {
return true;
}
@@ -804,9 +808,9 @@ bool BuilderPrivate::visitHeader(const char *cFileName) const
// Parse the following system headers to get the correct typdefs for types like
// int32_t, which are used in the macOS implementation of OpenGL framework.
if (cCompareFileName(baseName, "gltypes.h")
- || cStringStartsWith(cFileName, "/usr/include/_types")
- || cStringStartsWith(cFileName, "/usr/include/_types")
- || cStringStartsWith(cFileName, "/usr/include/sys/_types")) {
+ || cStringContains(cFileName, "/usr/include/stdint.h")
+ || cStringContains(cFileName, "/usr/include/_types")
+ || cStringContains(cFileName, "/usr/include/sys/_types")) {
return true;
}
#endif // Q_OS_MACOS
diff --git a/sources/shiboken2/doc/typesystem_specifying_types.rst b/sources/shiboken2/doc/typesystem_specifying_types.rst
index 221519541..e43b878ba 100644
--- a/sources/shiboken2/doc/typesystem_specifying_types.rst
+++ b/sources/shiboken2/doc/typesystem_specifying_types.rst
@@ -81,14 +81,17 @@ rejection
<typesystem>
<rejection class="..."
function-name="..."
+ argument-type="..."
field-name="..." />
</typesystem>
- The **class** attribute is the C++ class name of the class to reject. Use the
- *optional* **function-name** or **field-name** attributes to reject a particular
- function or field. Note that the **field-name** and **function-name** cannot
- be specified at the same time. To remove all occurrences of a given field or
- function, set the class attribute to \*.
+ The **class** attribute is the C++ class name of the class to reject. Use
+ the *optional* **function-name**, **argument-type**, or **field-name**
+ attributes to reject a particular function, function with arguments of a
+ particular type, or a field. Note that the **field-name** and
+ **function-name**/**argument-type** cannot be specified at the same time.
+ To remove all occurrences of a given field or function, set the class
+ attribute to \*.
.. _primitive-type:
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index afca7fa08..1919f2825 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -376,8 +376,9 @@ SbkObjectType *SbkObject_TypeF(void)
{
static PyTypeObject *type = nullptr;
if (!type) {
- type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpec(&SbkObject_Type_spec));
- Py_TYPE(type) = SbkObjectType_TypeF();
+ auto *obj = SbkType_FromSpec(&SbkObject_Type_spec);
+ type = reinterpret_cast<PyTypeObject *>(obj);
+ obj->ob_type = SbkObjectType_TypeF();
Py_INCREF(Py_TYPE(type));
type->tp_weaklistoffset = offsetof(SbkObject, weakreflist);
type->tp_dictoffset = offsetof(SbkObject, ob_dict);
@@ -521,7 +522,11 @@ void SbkObjectTypeDealloc(PyObject *pyObj)
PyObject_GC_UnTrack(pyObj);
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_BEGIN(pyObj, 1);
+# else
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+# endif
#endif
if (sotp) {
if (sotp->user_data && sotp->d_func) {
@@ -536,7 +541,11 @@ void SbkObjectTypeDealloc(PyObject *pyObj)
sotp = nullptr;
}
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_END;
+# else
Py_TRASHCAN_SAFE_END(pyObj);
+# endif
#endif
if (PepRuntime_38_flag) {
// PYSIDE-939: Handling references correctly.
@@ -1161,7 +1170,7 @@ introduceWrapperType(PyObject *enclosingObject,
typeSpec->slots[0].pfunc = reinterpret_cast<void *>(baseType ? baseType : SbkObject_TypeF());
PyObject *heaptype = SbkType_FromSpecWithBases(typeSpec, baseTypes);
- Py_TYPE(heaptype) = SbkObjectType_TypeF();
+ heaptype->ob_type = SbkObjectType_TypeF();
Py_INCREF(Py_TYPE(heaptype));
auto *type = reinterpret_cast<SbkObjectType *>(heaptype);
#if PY_VERSION_HEX < 0x03000000
@@ -1526,6 +1535,7 @@ bool setCppPointer(SbkObject *sbkObj, PyTypeObject *desiredType, void *cptr)
bool isValid(PyObject *pyObj)
{
if (!pyObj || pyObj == Py_None
+ || PyType_Check(pyObj) != 0
|| Py_TYPE(Py_TYPE(pyObj)) != SbkObjectType_TypeF()) {
return true;
}
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp
index 7dc73dfbc..38e702296 100644
--- a/sources/shiboken2/libshiboken/sbkenum.cpp
+++ b/sources/shiboken2/libshiboken/sbkenum.cpp
@@ -330,13 +330,21 @@ void SbkEnumTypeDealloc(PyObject *pyObj)
PyObject_GC_UnTrack(pyObj);
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_BEGIN(pyObj, 1);
+# else
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+# endif
#endif
if (PepType_SETP(sbkType)->converter) {
Shiboken::Conversions::deleteConverter(PepType_SETP(sbkType)->converter);
}
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_END;
+# else
Py_TRASHCAN_SAFE_END(pyObj);
+# endif
#endif
if (PepRuntime_38_flag) {
// PYSIDE-939: Handling references correctly.
@@ -752,9 +760,10 @@ newTypeWithName(const char *name,
static auto basetype = SbkEnum_TypeF();
Py_INCREF(basetype);
PyTuple_SetItem(bases, 0, reinterpret_cast<PyObject *>(basetype));
- auto *type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpecWithBases(&newspec, bases));
+ auto *obj = SbkType_FromSpecWithBases(&newspec, bases);
+ auto *type = reinterpret_cast<PyTypeObject *>(obj);
PyErr_Print();
- Py_TYPE(type) = SbkEnumType_TypeF();
+ obj->ob_type = SbkEnumType_TypeF();
auto *enumType = reinterpret_cast<SbkEnumType *>(type);
PepType_SETP(enumType)->cppName = cppName;
diff --git a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp
index 996968fa1..cc25b349d 100644
--- a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp
+++ b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp
@@ -116,8 +116,13 @@ std::ostream &operator<<(std::ostream &str, PyArrayObject *o)
str << " NPY_ARRAY_NOTSWAPPED";
if ((flags & NPY_ARRAY_WRITEABLE) != 0)
str << " NPY_ARRAY_WRITEABLE";
+#if NPY_VERSION >= 0x00000010 // NPY_1_23_API_VERSION
+ if ((flags & NPY_ARRAY_WRITEBACKIFCOPY) != 0)
+ str << " NPY_ARRAY_WRITEBACKIFCOPY";
+#else
if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0)
str << " NPY_ARRAY_UPDATEIFCOPY";
+#endif
} else {
str << '0';
}
diff --git a/sources/shiboken2/libshiboken/sbkstring.cpp b/sources/shiboken2/libshiboken/sbkstring.cpp
index 077fb531b..0f83aeef0 100644
--- a/sources/shiboken2/libshiboken/sbkstring.cpp
+++ b/sources/shiboken2/libshiboken/sbkstring.cpp
@@ -41,8 +41,14 @@
#include "sbkstaticstrings_p.h"
#include "autodecref.h"
-#include <vector>
-#include <unordered_set>
+#if PY_VERSION_HEX >= 0x03000000
+# define USE_INTERN_STRINGS
+#endif
+
+#ifndef USE_INTERN_STRINGS
+# include <vector>
+# include <unordered_set>
+#endif
namespace Shiboken
{
@@ -233,6 +239,13 @@ Py_ssize_t len(PyObject *str)
// PyObject *attr = PyObject_GetAttr(obj, name());
//
+#ifdef USE_INTERN_STRINGS
+PyObject *createStaticString(const char *str)
+{
+ return PyUnicode_InternFromString(str);
+}
+#else
+
using StaticStrings = std::unordered_set<PyObject *>;
static void finalizeStaticStrings(); // forward
@@ -283,6 +296,8 @@ PyObject *createStaticString(const char *str)
return result;
}
+#endif // !USE_INTERN_STRINGS
+
///////////////////////////////////////////////////////////////////////
//
// PYSIDE-1019: Helper function for snake_case vs. camelCase names
diff --git a/sources/shiboken2/shiboken_version.py b/sources/shiboken2/shiboken_version.py
index 80dd16ae0..88792a380 100644
--- a/sources/shiboken2/shiboken_version.py
+++ b/sources/shiboken2/shiboken_version.py
@@ -39,7 +39,7 @@
major_version = "5"
minor_version = "15"
-patch_version = "10"
+patch_version = "11"
# For example: "a", "b", "rc"
# (which means "alpha", "beta", "release candidate").
diff --git a/sources/shiboken2/shibokenmodule/CMakeLists.txt b/sources/shiboken2/shibokenmodule/CMakeLists.txt
index 9b2b58528..c861caf29 100644
--- a/sources/shiboken2/shibokenmodule/CMakeLists.txt
+++ b/sources/shiboken2/shibokenmodule/CMakeLists.txt
@@ -41,6 +41,14 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/_config.py"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken.pyi"
+ "${CMAKE_CURRENT_BINARY_DIR}/Shiboken.pyi" @ONLY)
+# typing support for mypy
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/py.typed.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/py.typed" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Shiboken.pyi"
+ "${CMAKE_CURRENT_BINARY_DIR}/py.typed"
+ DESTINATION "${PYTHON_SITE_PACKAGES}/shiboken2")
# Variable from enclosing scope.
foreach(item IN LISTS shiboken_python_files)
diff --git a/sources/shiboken2/shibokenmodule/Shiboken.pyi b/sources/shiboken2/shibokenmodule/Shiboken.pyi
new file mode 100644
index 000000000..93556ba40
--- /dev/null
+++ b/sources/shiboken2/shibokenmodule/Shiboken.pyi
@@ -0,0 +1,54 @@
+#############################################################################
+##
+## Copyright (C) 2022 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:COMM$
+##
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from __future__ import annotations
+
+"""
+This file contains the exact signatures for all functions in module
+Shiboken, except for defaults which are replaced by "...".
+"""
+
+# Module `Shiboken`
+
+from shiboken2 import Shiboken
+
+
+class Object(object):
+
+ def __init__(self) -> None: ...
+
+
+class VoidPtr(object): ...
+
+
+def _unpickle_enum(arg__1: object, arg__2: object) -> object: ...
+def createdByPython(arg__1: Shiboken.Object) -> bool: ...
+def delete(arg__1: Shiboken.Object) -> None: ...
+def dump(arg__1: object) -> str: ...
+def getAllValidWrappers() -> Shiboken.Object: ...
+def getCppPointer(arg__1: Shiboken.Object) -> Shiboken.Object: ...
+def invalidate(arg__1: Shiboken.Object) -> None: ...
+def isValid(arg__1: object) -> bool: ...
+def ownedByPython(arg__1: Shiboken.Object) -> bool: ...
+def wrapInstance(arg__1: int, arg__2: type) -> Shiboken.Object: ...
+
+
+# eof
diff --git a/sources/shiboken2/shibokenmodule/py.typed.in b/sources/shiboken2/shibokenmodule/py.typed.in
new file mode 100644
index 000000000..0e76a07dc
--- /dev/null
+++ b/sources/shiboken2/shibokenmodule/py.typed.in
@@ -0,0 +1 @@
+# this is a marker file for mypy