aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside6/CMakeLists.txt5
-rw-r--r--sources/pyside6/PySide6/support/generate_pyi.py3
-rw-r--r--sources/pyside6/cmake/PySideSetup.cmake12
-rw-r--r--sources/pyside6/libpyside/pyside.cpp5
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_extend.cpp9
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_helper.cpp7
6 files changed, 28 insertions, 13 deletions
diff --git a/sources/pyside6/CMakeLists.txt b/sources/pyside6/CMakeLists.txt
index 233880997..51599c1b1 100644
--- a/sources/pyside6/CMakeLists.txt
+++ b/sources/pyside6/CMakeLists.txt
@@ -11,7 +11,10 @@ add_subdirectory(libpyside)
find_package(Qt${QT_MAJOR_VERSION}Designer)
if(Qt${QT_MAJOR_VERSION}UiTools_FOUND AND Qt${QT_MAJOR_VERSION}Designer_FOUND)
add_subdirectory(plugins/uitools)
- add_subdirectory(plugins/designer)
+ # PYSIDE-535: Enable when PyPy supports embedding
+ if (NOT PYPY_VERSION)
+ add_subdirectory(plugins/designer)
+ endif()
endif()
add_subdirectory(PySide6)
diff --git a/sources/pyside6/PySide6/support/generate_pyi.py b/sources/pyside6/PySide6/support/generate_pyi.py
index ecc04019b..211df8590 100644
--- a/sources/pyside6/PySide6/support/generate_pyi.py
+++ b/sources/pyside6/PySide6/support/generate_pyi.py
@@ -98,7 +98,8 @@ def generate_all_pyi(outpath, options):
generate_pyi(import_name, outpath, options)
-if __name__ == "__main__":
+# PYSIDE-535: Disable pyi generation until things work.
+if __name__ == "__main__" and not hasattr(sys, "pypy_version_info"):
parser = argparse.ArgumentParser(
description="This script generates the .pyi file for all PySide modules.")
parser.add_argument("modules", nargs="+",
diff --git a/sources/pyside6/cmake/PySideSetup.cmake b/sources/pyside6/cmake/PySideSetup.cmake
index b46d09b57..4f7c71626 100644
--- a/sources/pyside6/cmake/PySideSetup.cmake
+++ b/sources/pyside6/cmake/PySideSetup.cmake
@@ -46,6 +46,18 @@ if(NOT PYSIDE_VERSION_OUTPUT)
message(FATAL_ERROR "Could not identify PySide6 version. Error: ${PYSIDE_VERSION_OUTPUT_ERROR}")
endif()
+# Detect if the Python interpreter is actually PyPy
+execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "if True:
+ pypy_version = ''
+ import sys
+ if hasattr(sys, 'pypy_version_info'):
+ pypy_version = '.'.join(map(str, sys.pypy_version_info[:3]))
+ print(pypy_version)
+ "
+ OUTPUT_VARIABLE PYPY_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
list(GET PYSIDE_VERSION_OUTPUT 0 BINDING_API_MAJOR_VERSION)
list(GET PYSIDE_VERSION_OUTPUT 1 BINDING_API_MINOR_VERSION)
list(GET PYSIDE_VERSION_OUTPUT 2 BINDING_API_MICRO_VERSION)
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp
index 17c673149..51353afe2 100644
--- a/sources/pyside6/libpyside/pyside.cpp
+++ b/sources/pyside6/libpyside/pyside.cpp
@@ -571,8 +571,13 @@ bool registerInternalQtConf()
// PyInstaller executable.
// This will disable the internal qt.conf which points to the PySide6 subdirectory (due to the
// subdirectory not existing anymore).
+#ifndef PYPY_VERSION
QString executablePath =
QString::fromWCharArray(Py_GetProgramFullPath());
+#else
+ // PYSIDE-535: FIXME: Add this function when available.
+ QString executablePath = QLatin1String("missing Py_GetProgramFullPath");
+#endif // PYPY_VERSION
QString appDirPath = QFileInfo(executablePath).absolutePath();
QString maybeQtConfPath = QDir(appDirPath).filePath(QStringLiteral("qt.conf"));
bool executableQtConfAvailable = QFileInfo::exists(maybeQtConfPath);
diff --git a/sources/shiboken6/libshiboken/signature/signature_extend.cpp b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
index 880d10dd7..b60b20b7a 100644
--- a/sources/shiboken6/libshiboken/signature/signature_extend.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
@@ -250,15 +250,6 @@ static PyGetSetDef new_PyMethodDescr_getsets[] = {
{nullptr, nullptr, nullptr, nullptr, nullptr}
};
-static PyGetSetDef new_PyType_getsets[] = {
- {const_cast<char *>("__doc__"), reinterpret_cast<getter>(pyside_tp_get___doc__),
- nullptr, nullptr, nullptr},
- {const_cast<char *>("__signature__"), reinterpret_cast<getter>(pyside_tp_get___signature__),
- reinterpret_cast<setter>(pyside_set___signature__),
- nullptr, nullptr},
- {nullptr, nullptr, nullptr, nullptr, nullptr}
-};
-
static PyGetSetDef new_PyWrapperDescr_getsets[] = {
{const_cast<char *>("__doc__"), reinterpret_cast<getter>(pyside_wd_get___doc__),
nullptr, nullptr, nullptr},
diff --git a/sources/shiboken6/libshiboken/signature/signature_helper.cpp b/sources/shiboken6/libshiboken/signature/signature_helper.cpp
index 4a2130a9d..1bf781bee 100644
--- a/sources/shiboken6/libshiboken/signature/signature_helper.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_helper.cpp
@@ -79,8 +79,6 @@ static int _fixup_getset(PyTypeObject *type, const char *name, PyGetSetDef *new_
for (; md->name != nullptr; md++)
if (strcmp(md->name, name) == 0)
return 1;
- // staticmethod has just a `__doc__` in the class
- assert(strcmp(type->tp_name, "staticmethod") == 0 && strcmp(name, "__doc__") == 0);
return 0;
}
@@ -107,8 +105,13 @@ int add_more_getsets(PyTypeObject *type, PyGetSetDef *gsp, PyObject **doc_descr)
AutoDecRef descr(PyDescr_NewGetSet(type, gsp));
if (descr.isNull())
return -1;
+#ifndef PYPY_VERSION
+ // PYSIDE-535: We cannot set the attribute. This will be re-implemented
+ // in a clean way, either with extra heaptypes or with a
+ // helper dict for signatures.
if (PyDict_SetItemString(dict, gsp->name, descr) < 0)
return -1;
+#endif
}
PyType_Modified(type);
return 0;