aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-07-25 12:08:12 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-07-25 16:02:52 +0000
commit8bb8588c3627515fa914e33db0199aee3300e1fd (patch)
tree12a33667f4b658cd12aeca604fc28074b55c29a2
parent5b3c98fb3f3ff8b6004a1b03806aa31011d07849 (diff)
tools: update missing bindings script to 6.3
Change-Id: I893b995a616e7473fa81cbf5e51eaeeb1c90d2d3 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 73be208de02456860ace00d3548b49ced1228290) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tools/missing_bindings/config.py36
-rw-r--r--tools/missing_bindings/main.py57
-rw-r--r--tools/missing_bindings/requirements.txt4
3 files changed, 41 insertions, 56 deletions
diff --git a/tools/missing_bindings/config.py b/tools/missing_bindings/config.py
index 4624d4a74..76446a0e6 100644
--- a/tools/missing_bindings/config.py
+++ b/tools/missing_bindings/config.py
@@ -47,11 +47,11 @@ modules_to_test = {
'QtQuick': 'qtquick-module.html',
'QtQuickWidgets': 'qtquickwidgets-module.html',
'QtQuickControls2': 'qtquickcontrols2-module.html',
- # QtQuick3D - no python bindings
+ 'QtQuick3D': 'qtquick3d-module.html',
'QtSql': 'qtsql-module.html',
'QtWidgets': 'qtwidgets-module.html',
'QtConcurrent': 'qtconcurrent-module.html',
- # QtDBUS - no python bindings
+ 'QtDBus': 'qtdbus-module.html',
'QtHelp': 'qthelp-module.html',
'QtOpenGL': 'qtopengl-module.html',
'QtPrintSupport': 'qtprintsupport-module.html',
@@ -66,32 +66,32 @@ modules_to_test = {
'Qt3DRender': 'qt3drender-module.html',
'Qt3DAnimation': 'qt3danimation-module.html',
'Qt3DExtras': 'qt3dextras-module.html',
- # 'QtNetworkAuth': 'qtnetworkauth-module.html', # no python bindings
+ 'QtNetworkAuth': 'qtnetworkauth-module.html',
# 'QtCoAp' -- TODO
# 'QtMqtt' -- TODO
# 'QtOpcUA' -- TODO
# 6.1
- # 'QtScxml': 'qtscxml-module.html',
- # 'QtCharts': 'qtcharts-module.html',
- # 'QtDataVisualization': 'qtdatavisualization-module.html',
+ 'QtScxml': 'qtscxml-module.html',
+ 'QtCharts': 'qtcharts-module.html',
+ 'QtDataVisualization': 'qtdatavisualization-module.html',
# 6.2
'QtBluetooth': 'qtbluetooth-module.html',
- # 'QtPositioning': 'qtpositioning-module.html',
- # 'QtMultimedia': 'qtmultimedia-module.html',
- # 'QtRemoteObjects': 'qtremoteobjects-module.html',
- # 'QtSensors': 'qtsensors-module.html',
- # 'QtSerialPort': 'qtserialport-module.html',
- # 'QtWebChannel': 'qtwebchannel-module.html',
- # 'QtWebEngine': 'qtwebengine-module.html',
- # 'QtWebEngineCore': 'qtwebenginecore-module.html',
- # 'QtWebEngineWidgets': 'qtwebenginewidgets-module.html',
- # 'QtWebSockets': 'qtwebsockets-module.html',
+ 'QtPositioning': 'qtpositioning-module.html',
+ 'QtMultimedia': 'qtmultimedia-module.html',
+ 'QtRemoteObjects': 'qtremoteobjects-module.html',
+ 'QtSensors': 'qtsensors-module.html',
+ 'QtSerialPort': 'qtserialport-module.html',
+ 'QtWebChannel': 'qtwebchannel-module.html',
+ 'QtWebEngineCore': 'qtwebenginecore-module.html',
+ 'QtWebEngineQuick': 'qtwebenginequick-module.html',
+ 'QtWebEngineWidgets': 'qtwebenginewidgets-module.html',
+ 'QtWebSockets': 'qtwebsockets-module.html',
# 6.x
- # 'QtSpeech': 'qtspeech-module.html',
- # 'QtMultimediaWidgets': 'qtmultimediawidgets-module.html',
+ #'QtSpeech': 'qtspeech-module.html',
+ 'QtMultimediaWidgets': 'qtmultimediawidgets-module.html',
# 'QtLocation': 'qtlocation-module.html',
# Not in 6
diff --git a/tools/missing_bindings/main.py b/tools/missing_bindings/main.py
index 3aac2d5fd..3c2485eec 100644
--- a/tools/missing_bindings/main.py
+++ b/tools/missing_bindings/main.py
@@ -48,7 +48,7 @@
# PySide6.
#
# Example invocation of script:
-# python missing_bindings.py --qt-version 6.0 -w all
+# python missing_bindings.py --qt-version 6.3 -w all
# --qt-version - specify which version of qt documentation to load.
# -w - if PyQt6 is an installed package, check if the tested
# class also exists there.
@@ -64,8 +64,8 @@ from bs4 import BeautifulSoup
from config import modules_to_test, types_to_ignore
qt_documentation_website_prefixes = {
- "6.0": "https://doc.qt.io/qt-6/",
- "dev": "https://doc-snapshots.qt.io/qt5-dev/",
+ "6.3": "https://doc.qt.io/qt-6/",
+ "dev": "https://doc-snapshots.qt.io/qt6-dev/",
}
@@ -93,8 +93,8 @@ def get_parser():
parser.add_argument(
"--qt-version",
"-v",
- default="6.0",
- choices=["6.0", "dev"],
+ default="6.3",
+ choices=["6.3", "dev"],
type=str,
dest="version",
help="the Qt version to use to check for types",
@@ -106,7 +106,7 @@ def get_parser():
choices=["all", "in-pyqt", "not-in-pyqt"],
type=str,
dest="which_missing",
- help="Which missing types to show (all, or just those " "that are not present in PyQt)",
+ help="Which missing types to show (all, or just those that are not present in PyQt)",
)
return parser
@@ -114,30 +114,28 @@ def get_parser():
def wikilog(*pargs, **kw):
print(*pargs)
- computed_str = ""
- for arg in pargs:
- computed_str += str(arg)
+ computed_str = "".join(str(arg) for arg in pargs)
style = "text"
if "style" in kw:
style = kw["style"]
if style == "heading1":
- computed_str = "= " + computed_str + " ="
+ computed_str = f"= {computed_str} ="
elif style == "heading5":
- computed_str = "===== " + computed_str + " ====="
+ computed_str = f"===== {computed_str} ====="
elif style == "with_newline":
- computed_str += "\n"
+ computed_str = f"{computed_str}\n"
elif style == "bold_colon":
computed_str = computed_str.replace(":", ":'''")
- computed_str += "'''"
- computed_str += "\n"
+ computed_str = f"{computed_str}'''\n"
elif style == "error":
- computed_str = "''" + computed_str.strip("\n") + "''\n"
+ computed_str = computed_str.strip('\n')
+ computed_str = f"''{computed_str}''\n"
elif style == "text_with_link":
computed_str = computed_str
elif style == "code":
- computed_str = " " + computed_str
+ computed_str = f" {computed_str}"
elif style == "end":
return
@@ -184,7 +182,7 @@ if __name__ == "__main__":
)
wikilog(
- "Similar report:\n" "https://gist.github.com/ethanhs/6c626ca4e291f3682589699296377d3a",
+ "Similar report:\n https://gist.github.com/ethanhs/6c626ca4e291f3682589699296377d3a",
style="text_with_link",
)
@@ -226,8 +224,6 @@ if __name__ == "__main__":
try:
pyqt_module_name = module_name
- if module_name == "QtCharts":
- pyqt_module_name = module_name[:-1]
pyqt_tested_module = getattr(
__import__(pyqt_package_name, fromlist=[pyqt_module_name]), pyqt_module_name
@@ -249,8 +245,7 @@ if __name__ == "__main__":
types_on_html_page = []
for link in links:
- link_text = link.text
- link_text = link_text.replace("::", ".")
+ link_text = link.text.replace("::", ".")
if link_text not in types_to_ignore:
types_on_html_page.append(link_text)
@@ -261,14 +256,7 @@ if __name__ == "__main__":
missing_types = []
for qt_type in types_on_html_page:
try:
- pyside_qualified_type = "pyside_tested_module."
-
- if "QtCharts" == module_name:
- pyside_qualified_type += "QtCharts."
- elif "DataVisualization" in module_name:
- pyside_qualified_type += "QtDataVisualization."
-
- pyside_qualified_type += qt_type
+ pyside_qualified_type = f"pyside_tested_module.{qt_type}"
eval(pyside_qualified_type)
except Exception as e:
print("Failed eval-in pyside qualified types")
@@ -279,16 +267,9 @@ if __name__ == "__main__":
is_present_in_pyqt = False
try:
- pyqt_qualified_type = "pyqt_tested_module."
-
- if "Charts" in module_name:
- pyqt_qualified_type += "QtCharts."
- elif "DataVisualization" in module_name:
- pyqt_qualified_type += "QtDataVisualization."
-
- pyqt_qualified_type += qt_type
+ pyqt_qualified_type = f"pyqt_tested_module.{qt_type}"
eval(pyqt_qualified_type)
- missing_type += " (is present in PyQt6)"
+ missing_type = f"{missing_type} (is present in PyQt6)"
missing_types_compared_to_pyqt += 1
total_missing_types_count_compared_to_pyqt += 1
is_present_in_pyqt = True
diff --git a/tools/missing_bindings/requirements.txt b/tools/missing_bindings/requirements.txt
index 732522d26..f715bea38 100644
--- a/tools/missing_bindings/requirements.txt
+++ b/tools/missing_bindings/requirements.txt
@@ -6,3 +6,7 @@ PySide6
# PyQt
PyQt6
PyQt6-3D
+PyQt6-Charts
+PyQt6-DataVisualization
+PyQt6-NetworkAuth
+PyQt6-WebEngine