From a67d90d9304e21b849a3a3a7517675251279d3f9 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Mon, 16 Dec 2024 16:48:28 +0100 Subject: [PATCH] api(Deprecated): Remove strong requirement on \deprecated Because some method (only QgsGeometry::set actually) can be deprecated only in python, not in C++. But \deprecated triggers the need for Q_DECL_DEPRECATED --- .../PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in | 4 +--- python/core/auto_generated/geometry/qgsgeometry.sip.in | 4 +--- scripts/sipify.py | 7 ++++++- src/core/geometry/qgsgeometry.h | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in index 63b4107423f5..1d245ba35c67 100644 --- a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in @@ -148,7 +148,7 @@ and a deep copy. Where possible, use :py:func:`~QgsGeometry.constGet` instead. .. seealso:: :py:func:`set` %End - void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated="Since 3.0. "/; + void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated/; %Docstring Sets the underlying geometry store. Ownership of geometry is transferred. @@ -165,8 +165,6 @@ Sets the underlying geometry store. Ownership of geometry is transferred. .. seealso:: :py:func:`get` .. seealso:: :py:func:`constGet` - -.. deprecated:: 3.0 %End bool isNull() const /HoldGIL/; diff --git a/python/core/auto_generated/geometry/qgsgeometry.sip.in b/python/core/auto_generated/geometry/qgsgeometry.sip.in index 22cd8ba42664..7dfc2cfc47ba 100644 --- a/python/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometry.sip.in @@ -148,7 +148,7 @@ and a deep copy. Where possible, use :py:func:`~QgsGeometry.constGet` instead. .. seealso:: :py:func:`set` %End - void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated="Since 3.0. "/; + void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated/; %Docstring Sets the underlying geometry store. Ownership of geometry is transferred. @@ -165,8 +165,6 @@ Sets the underlying geometry store. Ownership of geometry is transferred. .. seealso:: :py:func:`get` .. seealso:: :py:func:`constGet` - -.. deprecated:: 3.0 %End bool isNull() const /HoldGIL/; diff --git a/scripts/sipify.py b/scripts/sipify.py index 5175a095e5b7..517d1da9808f 100755 --- a/scripts/sipify.py +++ b/scripts/sipify.py @@ -1200,7 +1200,12 @@ def fix_annotations(line): # these have no effect (and aren't required) on sip >= 6 replacements[r"SIP_THROW\(\s*([\w\s,]+?)\s*\)"] = "" - replacements[r"\bSIP_DEPRECATED\b"] = f'/Deprecated="{CONTEXT.deprecated_message}"/' + if CONTEXT.deprecated_message: + replacements[r"\bSIP_DEPRECATED\b"] = ( + f'/Deprecated="{CONTEXT.deprecated_message}"/' + ) + else: + replacements[r"\bSIP_DEPRECATED\b"] = f"/Deprecated/" for _pattern, replacement in replacements.items(): line = re.sub(_pattern, replacement, line) diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 2eea53d1723e..c02ee5171f67 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -227,7 +227,6 @@ class CORE_EXPORT QgsGeometry * * \see get() * \see constGet() - * \deprecated QGIS 3.0 */ void set( QgsAbstractGeometry *geometry SIP_TRANSFER ) SIP_DEPRECATED;