diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-17 13:41:55 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-17 13:41:55 +0200 |
commit | 299e0b878830488f48a8acd946433b20a92849b2 (patch) | |
tree | 2c92429c99c1d806ad00f14b7af33591080bb7d4 | |
parent | 4bbbf01abbae1509f9d2ee46ffaf20840abd278e (diff) | |
parent | b0bfeaf894344e31b5175dbbd3ce371fae5dee5b (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I67ca2ec01e220ef32c61aba17a0be4e46f50cb5f
-rw-r--r-- | build_scripts/platforms/unix.py | 2 | ||||
-rw-r--r-- | build_scripts/platforms/windows_desktop.py | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/CMakeLists.txt | 3 | ||||
-rw-r--r-- | sources/pyside2/PySide2/py.typed.in | 1 | ||||
-rw-r--r-- | sources/pyside2/PySide2/support/generate_pyi.py | 4 | ||||
-rw-r--r-- | sources/pyside2/libpyside/signalmanager.cpp | 7 | ||||
-rw-r--r-- | sources/shiboken2/doc/gettingstarted.rst | 4 |
7 files changed, 19 insertions, 4 deletions
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py index fcbd010e2..b842510ff 100644 --- a/build_scripts/platforms/unix.py +++ b/build_scripts/platforms/unix.py @@ -188,7 +188,7 @@ def prepare_packages_posix(self, vars): copydir( "{build_dir}/pyside2/{st_package_name}", "{st_build_dir}/{st_package_name}", - filter=["*.pyi"], + filter=["*.pyi", "py.typed"], vars=vars) if not OPTION["NOEXAMPLES"]: diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index 88114fdaa..750a064b4 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -197,7 +197,7 @@ def prepare_packages_win32(self, vars): copydir( "{build_dir}/pyside2/{st_package_name}", "{st_build_dir}/{st_package_name}", - filter=["*.pyi"], + filter=["*.pyi", "py.typed"], vars=vars) copydir( diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt index e39db75a1..aa37f19bc 100644 --- a/sources/pyside2/PySide2/CMakeLists.txt +++ b/sources/pyside2/PySide2/CMakeLists.txt @@ -8,6 +8,9 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in" "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_config.py.in" "${CMAKE_CURRENT_BINARY_DIR}/_config.py" @ONLY) +# typing support for mypy +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/py.typed.in" + "${CMAKE_CURRENT_BINARY_DIR}/py.typed" @ONLY) # Use absolute path instead of relative path, to avoid ninja build errors due to # duplicate file dependency inconsistency. diff --git a/sources/pyside2/PySide2/py.typed.in b/sources/pyside2/PySide2/py.typed.in new file mode 100644 index 000000000..0e76a07dc --- /dev/null +++ b/sources/pyside2/PySide2/py.typed.in @@ -0,0 +1 @@ +# this is a marker file for mypy diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py index e60645701..f173ec2fc 100644 --- a/sources/pyside2/PySide2/support/generate_pyi.py +++ b/sources/pyside2/PySide2/support/generate_pyi.py @@ -138,6 +138,10 @@ class Formatter(Writer): self.print("# Module", mod_name) self.print("import PySide2") from PySide2.support.signature import typing + self.print("try:") + self.print(" import typing") + self.print("except ImportError:") + self.print(" from PySide2.support.signature import typing") self.print("from PySide2.support.signature import typing") self.print("from PySide2.support.signature.mapping import (") self.print(" Virtual, Missing, Invalid, Default, Instance)") diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp index 0fe0d0092..8e8cc9f02 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp +++ b/sources/pyside2/libpyside/signalmanager.cpp @@ -114,18 +114,24 @@ namespace PySide { PyObjectWrapper::PyObjectWrapper() :m_me(Py_None) { + // PYSIDE-813: When PYSIDE-164 was solved by adding some thread allowance, + // this code was no longer protected. It was hard to find this connection. + // See the website https://bugreports.qt.io/browse/PYSIDE-813 for details. + Shiboken::GilState gil; Py_XINCREF(m_me); } PyObjectWrapper::PyObjectWrapper(PyObject *me) : m_me(me) { + Shiboken::GilState gil; Py_XINCREF(m_me); } PyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other) : m_me(other.m_me) { + Shiboken::GilState gil; Py_XINCREF(m_me); } @@ -142,6 +148,7 @@ PyObjectWrapper::~PyObjectWrapper() void PyObjectWrapper::reset(PyObject *o) { + Shiboken::GilState gil; Py_XINCREF(o); Py_XDECREF(m_me); m_me = o; diff --git a/sources/shiboken2/doc/gettingstarted.rst b/sources/shiboken2/doc/gettingstarted.rst index e064cec5d..caeb5a909 100644 --- a/sources/shiboken2/doc/gettingstarted.rst +++ b/sources/shiboken2/doc/gettingstarted.rst @@ -28,9 +28,9 @@ If you need only Shiboken Generator, a simple build run would look like this:: --build-tests \ --parallel=8 \ --verbose-build \ - --internal-build=shiboken2-generator + --internal-build-type=shiboken2-generator -The same can be used for the module, changing the value of ``internal-build`` to +The same can be used for the module, changing the value of ``internal-build-type`` to ``shiboken2-module``. Using the wheels |