Commit Graph

20 Commits

Author SHA1 Message Date
tritao
b45a3025e6 Material: Remove XML binding files. 2025-03-26 13:01:41 +01:00
Joao Matos
4ec136b252 Material: Convert XML bindings to Python. 2025-03-26 12:18:02 +01:00
tritao
35420022e9 Tools: Improve handling of sequence_protocol in Python bindings generator.
This allows SequenceProtocol being initialized without all members which
simplifies Python authoring of binding files.
2025-03-26 12:18:02 +01:00
Joao Matos
a32478349b Part: Remove XML binding files.
This PR removes the Part XML API bindings files now that we have
equivalent Python binding files.
2025-03-25 21:28:52 +01:00
Joao Matos
bbe9fbccb5 PartDesign: Remove XML binding files. 2025-03-25 06:11:22 +01:00
Joao Matos
8a934297dc Gui: Remove XML binding files. 2025-03-24 22:47:33 +01:00
tritao
c20cc6804f App: Remove XML binding files.
This PR removes the App XML API bindings files now that we have
equivalent Python binding files.
2025-03-21 16:43:59 +01:00
tritao
2292f908c5 Tools: Use ModuleName when determining which modules to compare against XML bindings. 2025-03-21 16:43:59 +01:00
Joao Matos
154e00f9a3 Tools: Improve identation handling for attribute docstring comments. 2025-03-20 11:07:27 +01:00
tritao
b71d5fe684 Base: Remove XML binding files. 2025-03-19 20:04:19 -05:00
tritao
09918fac13 Tools: Re-enable XML comparison mode Python API bindings generator. 2025-03-19 08:32:06 -05:00
Chris Hennes
3197f9664f Merge pull request #20036 from hyarion/fix/remove-pyexport-warnings
Suppress erroneous warnings for GCC in python template
2025-03-07 14:41:22 +00:00
Benjamin Nauck
bef00d5a9c Tools: Suppress erroneous warnings for GCC 2025-03-06 21:47:50 +01:00
Chris Hennes
c11dbedde1 Merge pull request #19953 from hyarion/fix/remove-pyexport-warnings
Python bindings: Use designated initializers and remove zero-initialized fields
2025-03-06 14:38:45 +00:00
tritao
6792d6bfd7 Remove Python-generated bindings comparison against XML-generated version. 2025-03-03 10:22:41 -06:00
Benjamin Nauck
d017242584 Use designated initializers and remove zero-initialized fields 2025-03-03 11:02:19 +01:00
Joao Matos
2e879c8982 Tools: Update binding generator. 2025-03-01 16:23:54 +00:00
tritao
b97e695359 Tools: Introduce a Python-based API bindings template generator.
This extends the existing XML-based template generator to allow an
additional kind of Python-based input.

The Python code is read as source code to an AST to a typed model
equivalent to the existing XML model, and processed by the existing
code templates into compatible code.

This provides a few benefits, namely readability is much increased,
but more importantly, it allows associating the APIs with Python's new
typing information, which will allow to provide accurate type hinting
without additional downstream processing in the future.

Right now this is just a proof-of-concept but if the approach is
well received, then a more complete implementation can be done with
further conversion of existing binding files.

Here is an example of how it looks, though I still think the metadata
is too verbose and can be made to look nicer with some further work.

```python
from ..Base.Metadata import metadata
from ..Base.Persistence import PersistencePy
from typing import Any, Optional, List

@metadata(
    Father="PersistencePy",
    Name="DocumentPy",
    Twin="Document",
    TwinPointer="Document",
    Include="Gui/Document.h",
    Namespace="Gui",
    FatherInclude="Base/PersistencePy.h",
    FatherNamespace="Base"
)
class DocumentPy(PersistencePy):
    """
    This is a Document class.

    Author: Werner Mayer (wmayer@users.sourceforge.net)
    Licence: LGPL
    """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        """
        Constructor for DocumentPy.
        """
        super(DocumentPy, self).__init__(*args, **kwargs)
        pass

    def show(self, objName: str) -> None:
        """
        show(objName) -> None

        Show an object.

        Parameters:
            objName (str): Name of the `Gui.ViewProvider` to show.
        """
        pass
```
2025-02-21 16:32:13 +00:00
tritao
2a3f8d037e Tools: Add documentation for the Python-based bindings system. 2025-02-21 13:18:36 +00:00
tritao
21d3cc0e78 Tools: Move bindings generator into generator folder. 2025-02-08 16:11:01 +00:00