From 107eb625c28bba7234221aa0fd71b84dd09361e2 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Fri, 1 Nov 2019 11:38:42 +0100 Subject: Simplify recreation of registry files The registry files were recreated when they do not exist. This was used to trigger recreation on a file. We now include a comment line on top of the files. #recreate # uncomment this to enforce generation By uncommenting this line, a NameError is provoked, which has the desired effect without creating huge deltas in the repository. Change-Id: Idcc1015abae504f111102e8c9851f8ef45dcbdff Reviewed-by: Friedemann Kleint --- sources/pyside2/tests/registry/existence_test.py | 7 +++++++ sources/pyside2/tests/registry/init_platform.py | 1 + sources/shiboken2/libshiboken/signature_doc.rst | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py index 0313bd9f8..6db88a818 100644 --- a/sources/pyside2/tests/registry/existence_test.py +++ b/sources/pyside2/tests/registry/existence_test.py @@ -100,6 +100,13 @@ except SyntaxError: print("*** not a python file, removed:", shortpath) os.unlink(effectiveRefPath) have_refmodule = False +except NameError as e: + if "recreate" in e.args[0]: + print("*** explicit request to recreate:", shortpath) + else: + print("*** unexpected NameError:", e, "- creating", shortpath) + os.unlink(effectiveRefPath) + have_refmodule = False dict_name = "sig_dict" if have_refmodule and not hasattr(sig_exists, dict_name): print("*** wrong module without '{dict_name}', removed:" diff --git a/sources/pyside2/tests/registry/init_platform.py b/sources/pyside2/tests/registry/init_platform.py index 61964a3c1..a690a3120 100644 --- a/sources/pyside2/tests/registry/init_platform.py +++ b/sources/pyside2/tests/registry/init_platform.py @@ -219,6 +219,7 @@ def generate_all(): lines = f.readlines() license_line = next((lno for lno, line in enumerate(lines) if "$QT_END_LICENSE$" in line)) + fmt.print("#recreate # uncomment this to enforce generation") fmt.print("".join(lines[:license_line + 3])) version = sys.version.replace('\n', ' ') build = qt_build() diff --git a/sources/shiboken2/libshiboken/signature_doc.rst b/sources/shiboken2/libshiboken/signature_doc.rst index a984de4ce..cb9041d0c 100644 --- a/sources/shiboken2/libshiboken/signature_doc.rst +++ b/sources/shiboken2/libshiboken/signature_doc.rst @@ -265,6 +265,17 @@ we can now capture the error output of COIN and check the generated module in. +Explicitly Enforcing Recreation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The former way to regenerate the registry files was to remove the files +and check that in. This has the desired effect, but creates huge deltas. +As a more efficient way, we have prepared a comment in the first line +that contains the word "recreate". +By uncommenting this line, a NameError is triggered, which has the same +effect. + + init_platform.py ~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From c19c886f910e1035677c8b2738588243df7337c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Nov 2019 15:26:46 +0100 Subject: shiboken: Remove unused code Change-Id: Idf421747a41fbc7c58e8cc84023426bc12b47544 Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 7 ------- sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 1 - sources/shiboken2/ApiExtractor/abstractmetalang.h | 17 ----------------- sources/shiboken2/ApiExtractor/typesystem.cpp | 13 ------------- sources/shiboken2/ApiExtractor/typesystem.h | 2 -- 5 files changed, 40 deletions(-) diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index ae3cdd86b..73a887577 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1418,13 +1418,6 @@ void AbstractMetaBuilderPrivate::traverseFunctions(ScopeModelItem scopeItem, metaClass->setHasNonPrivateConstructor(true); } - // Classes with virtual destructors should always have a shell class - // (since we aren't registering the destructors, we need this extra check) - if (metaFunction->isDestructor() && metaFunction->isVirtual() - && metaFunction->visibility() != AbstractMetaAttributes::Private) { - metaClass->setForceShellClass(true); - } - if (!metaFunction->isDestructor() && !(metaFunction->isPrivate() && metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction)) { diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index 99e9d01a3..a040f3caa 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -1326,7 +1326,6 @@ AbstractMetaClass::AbstractMetaClass() m_hasPrivateDestructor(false), m_hasProtectedDestructor(false), m_hasVirtualDestructor(false), - m_forceShellClass(false), m_hasHashFunction(false), m_hasEqualsOperator(false), m_hasCloneOperator(false), diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index 077191471..e9ce4d71b 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -249,21 +249,11 @@ public: return m_originalAttributes & Private; } - bool wasProtected() const - { - return m_originalAttributes & Protected; - } - bool wasPublic() const { return m_originalAttributes & Public; } - bool wasFriendly() const - { - return m_originalAttributes & Friendly; - } - void setDocumentation(const Documentation& doc) { m_doc = doc; @@ -892,7 +882,6 @@ public: QString minimalSignature() const; QString debugSignature() const; // including virtual/override/final, etc., for debugging only. - QStringList possibleIntrospectionCompatibleSignatures() const; bool isModifiedRemoved(int types = TypeSystem::All) const; @@ -1530,11 +1519,6 @@ public: bool hasSignals() const; bool inheritsFrom(const AbstractMetaClass *other) const; - void setForceShellClass(bool on) - { - m_forceShellClass = on; - } - /** * Says if the class that declares or inherits a virtual function. * \return true if the class implements or inherits any virtual methods @@ -1732,7 +1716,6 @@ private: uint m_hasPrivateDestructor : 1; uint m_hasProtectedDestructor : 1; uint m_hasVirtualDestructor : 1; - uint m_forceShellClass : 1; uint m_hasHashFunction : 1; uint m_hasEqualsOperator : 1; uint m_hasCloneOperator : 1; diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index fa141670c..a1b98cd45 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -241,19 +241,6 @@ QString FlagsTypeEntry::targetLangName() const return m_targetLangName; } -/*! - * The Visual Studio 2002 compiler doesn't support these symbols, - * which our typedefs unforntuatly expand to. - */ -QString fixCppTypeName(const QString &name) -{ - if (name == QLatin1String("long long")) - return QLatin1String("qint64"); - if (name == QLatin1String("unsigned long long")) - return QLatin1String("quint64"); - return name; -} - QString TemplateInstance::expandCode() const { TemplateEntry *templateEntry = TypeDatabase::instance()->findTemplate(m_name); diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h index 6a88ecd4d..48733053d 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.h +++ b/sources/shiboken2/ApiExtractor/typesystem.h @@ -1684,8 +1684,6 @@ struct TypeRejection QDebug operator<<(QDebug d, const TypeRejection &r); #endif -QString fixCppTypeName(const QString &name); - class CustomConversion { public: -- cgit v1.2.3 From 10d1204326a33d3dd987496ff4d434be422b402f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 12 Nov 2019 08:53:26 +0100 Subject: Fix clang parsing with update MSCV versions Turn off clang check: STL1000: Unexpected compiler version, expected Clang 7 or newer Change-Id: I30e962174dfe468d570fae56c0e1b883c622a6a0 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp index f301733fe..d3e5e212f 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp +++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp @@ -309,6 +309,8 @@ QByteArrayList emulatedCompilerOptions() HeaderPaths headerPaths; result.append(QByteArrayLiteral("-fms-compatibility-version=19")); result.append(QByteArrayLiteral("-Wno-microsoft-enum-value")); + // Fix yvals_core.h: STL1000: Unexpected compiler version, expected Clang 7 or newer (MSVC2017 update) + result.append(QByteArrayLiteral("-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")); #elif defined(Q_CC_CLANG) HeaderPaths headerPaths = gppInternalIncludePaths(compilerFromCMake(QStringLiteral("clang++"))); result.append(noStandardIncludeOption()); -- cgit v1.2.3 From a75ab6b986ce570185e312b0d2a58f813525b728 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Nov 2019 12:30:02 +0100 Subject: Add 5.12.6 changelog Change-Id: Ia7dee36eec9e20598627c490bf5c33fb0d7620fe Reviewed-by: Cristian Maureira-Fredes --- dist/changes-5.12.6 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dist/changes-5.12.6 diff --git a/dist/changes-5.12.6 b/dist/changes-5.12.6 new file mode 100644 index 000000000..d1eba40c2 --- /dev/null +++ b/dist/changes-5.12.6 @@ -0,0 +1,29 @@ +Qt for Python 5.12.6 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 * +**************************************************************************** + + - [Fixes: PYSIDE-1007] Remove extra ref on QDataStream::setDevice + - [Fixes: PYSIDE-1051] Fix heaptype conflict with QtCore.QObject.__new__in Python 2.7 + + +**************************************************************************** +* Shiboken2 * +**************************************************************************** + + - No changes + -- cgit v1.2.3 From da5f43b6cbecac437f80fbb1b1405292b3962d3b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Nov 2019 12:43:44 +0100 Subject: create_changelog.py: Silence flake8 and Qt Creator's checker Change-Id: If61585c69e9f73aecd8b001523165df0967721ed Reviewed-by: Cristian Maureira-Fredes --- tools/create_changelog.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/create_changelog.py b/tools/create_changelog.py index 12c67d62f..d9ab24731 100644 --- a/tools/create_changelog.py +++ b/tools/create_changelog.py @@ -39,13 +39,11 @@ import re import sys -from textwrap import dedent from argparse import ArgumentParser, Namespace, RawTextHelpFormatter from subprocess import check_output, Popen, PIPE from typing import Dict, List -content = """ -Qt for Python @VERSION is a @TYPE release. +content = """Qt for Python @VERSION is a @TYPE release. For more details, refer to the online documentation included in this distribution. The documentation is also available online: @@ -137,9 +135,12 @@ def check_tag(tag: str) -> bool: def get_commit_content(sha: str) -> str: - command= "git log {} -n 1 --pretty=format:%s%n%n%b".format(sha) - print("{}: {}".format(get_commit_content.__name__, command), file=sys.stderr) + command = "git log {} -n 1 --pretty=format:%s%n%n%b".format(sha) + print("{}: {}".format(get_commit_content.__name__, command), + file=sys.stderr) out, err = Popen(command, stdout=PIPE, shell=True).communicate() + if err: + print(err, file=sys.stderr) return out.decode("utf-8") @@ -150,6 +151,8 @@ def git_command(versions: List[str], pattern: str): command += " | grep -o -E \"^[0-9a-f]{40}\"" print("{}: {}".format(git_command.__name__, command), file=sys.stderr) out_sha1, err = Popen(command, stdout=PIPE, shell=True).communicate() + if err: + print(err, file=sys.stderr) sha1_list = [s.decode("utf-8") for s in out_sha1.splitlines()] for sha in sha1_list: @@ -185,14 +188,15 @@ def gen_list(d: Dict[str, Dict[str, str]]) -> str: if d: return "".join(" - [{}] {}\n".format(v["task"], v["title"]) for _, v in d.items()) - else: - return " - No changes" + return " - No changes" + def sort_dict(d: Dict[str, Dict[str, str]]) -> Dict[str, Dict[str, str]]: return dict(sorted(d.items(), key=lambda kv: "{:5d}".format( int(kv[1]['task'].replace("PYSIDE-", ""))))) + if __name__ == "__main__": args = parse_options() @@ -213,7 +217,7 @@ if __name__ == "__main__": # Generate message print(content - .replace("@VERSION", args.release) - .replace("@TYPE", args.type) - .replace("@PYSIDE", gen_list(pyside2_commits)) - .replace("@SHIBOKEN", gen_list(shiboken2_commits))) + .replace("@VERSION", args.release) + .replace("@TYPE", args.type) + .replace("@PYSIDE", gen_list(pyside2_commits)) + .replace("@SHIBOKEN", gen_list(shiboken2_commits))) -- cgit v1.2.3