Skip to content

Commit

Permalink
api(Deprecated): Remove strong requirement on \deprecated
Browse files Browse the repository at this point in the history
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
  • Loading branch information
troopa81 committed Dec 16, 2024
1 parent 8ca2258 commit a67d90d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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/;
Expand Down
4 changes: 1 addition & 3 deletions python/core/auto_generated/geometry/qgsgeometry.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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/;
Expand Down
7 changes: 6 additions & 1 deletion scripts/sipify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/core/geometry/qgsgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ class CORE_EXPORT QgsGeometry
*
* \see get()
* \see constGet()
* \deprecated QGIS 3.0
*/
void set( QgsAbstractGeometry *geometry SIP_TRANSFER ) SIP_DEPRECATED;

Expand Down

0 comments on commit a67d90d

Please sign in to comment.