Commit Graph

45 Commits

Author SHA1 Message Date
Chris Hennes
dfb9baf678 Merge pull request #24262 from mnesarco/pyi-fixes-1 2025-11-29 20:23:37 -06:00
Frank Martinez
be7c10aea4 [bindings] Added generic twin pointer accessor 2025-11-29 20:22:38 -06:00
pre-commit-ci[bot]
5e0dd60ee5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-11 19:34:32 +00:00
Frank Martinez
73e67fefd1 [bindings] Automatic export of function signatures with annotations to runtime. (PyMethodDef.ml_doc) 2025-11-11 13:23:10 -05:00
Frank Martinez
39d15c011e black formatting 2025-11-11 13:23:10 -05:00
Frank Martinez
6b0b15f687 [bindings] Code cleanup 2025-11-11 13:23:09 -05:00
Frank Martinez
748004b4e4 [bindings] fix signatures in pyi files 2025-11-11 13:16:26 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
489e429b5c SPDX [ 29 ][ Src / Tools ] (#24999)
* [ Tools ]: Update SPDX License Identifiers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-11-02 16:21:34 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
546a43b8b8 Removed outdated UTF8 declaration [ Other ] (#24528)
* Removed outdated UTF8 declaration

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-13 18:34:43 +02:00
Markus Reitböck
2ce0323b8f cleanup remaining implementations of precompiled headers 2025-09-24 20:08:57 +02:00
Ian 'z0r0' Abreu
6fa1adf141 Cleaning up xml file generation, and erroneous export annotations from interface bindings. 2025-08-31 18:28:41 -04:00
Ian 'z0r0' Abreu
4fc94492cd Finalizing Python interface bindings for TechDraw. 2025-08-31 15:43:50 -04:00
Ian 'z0r0' Abreu
6d3fb9393a Finalizing Python interface bindings for Robot, Spreadsheet, Surface. 2025-08-31 15:41:14 -04:00
Ian 'z0r0' Abreu
6e75aef81c Finalizing Python interface bindings for Import, Measure, Mesh, Points. 2025-08-31 15:34:03 -04:00
Ian 'z0r0' Abreu
2b889560d1 Finalizing Python interface bindings for Fem. 2025-08-31 15:27:21 -04:00
Ian 'z0r0' Abreu
9008cdb8ee Finalizing Python interface bindings for CAM. 2025-08-31 15:24:02 -04:00
Ian 'z0r0' Abreu
c63ac5ffbc Finalizing Python interface bindings for assembly 2025-08-31 15:19:25 -04:00
Ian Abreu
3ecb701959 Core: Generation of python bindings for Techdraw (#22565)
* first working interfaces..

* adding the rest.

* updated all pyi files.

* running black for formatting.

* removing unused imports

* removing empty comments

* fixing typing declarations.

* removing inline comments.

* fixing pyObjectBase in CosmeticEdgePy

* removing erroneous tags.

* running black.

* fixing CenterLinePy

* fixing import issues.

* Fixing tuple.

* Enabling CosmeticEdge compilation.

* fixing comments, removing unused imports.

* fixing ordering
2025-08-04 10:36:32 -05:00
Chris Hennes
95a7dfd515 Remove boost::filesystem includes 2025-07-18 20:26:56 +02:00
wmayer
0576c129cd Base: Improve Python exception handling
If the Python profiler is activated then transporting the dict as
exception object is broken where InteractiveInterpreter::runCode()
fails to restore it.
To fix the problem use Exception::setPyException() instead inside
the macto PY_CATCH and the generated wrapper code.

This also improves exception handling in command line mode.
2025-06-04 14:14:20 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Jacob Oursland
fb528dd9fc python: Make const methods declared const in C++. 2025-04-16 20:19:41 -07:00
Chris Hennes
de13e777f4 Merge pull request #20643 from tritao/python-gen-include-pycxx
Tools: Add PyCXX includes to generated Python binding files.
2025-04-07 11:27:17 -05:00
tritao
63ed3e8dff Sketcher: Remove XML binding files.
These are not needed anyore with the Python bindings conversion.
2025-04-05 17:52:38 +02:00
tritao
80aca250ad Tools: Add PyCXX includes to generated Python binding files. 2025-04-05 12:03:23 +01:00
tritao
8ae48c3c8a Material: Remove XML binding files. 2025-03-26 13:01:41 +01:00
Joao Matos
e9fda68693 Material: Convert XML bindings to Python. 2025-03-26 12:18:02 +01:00
tritao
c3e10d4331 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
faabc3d7d6 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
ee4c9a6e8b PartDesign: Remove XML binding files. 2025-03-25 06:11:22 +01:00
Joao Matos
74493358da Gui: Remove XML binding files. 2025-03-24 22:47:33 +01:00
tritao
176f91eea8 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
997982ad20 Tools: Use ModuleName when determining which modules to compare against XML bindings. 2025-03-21 16:43:59 +01:00
Joao Matos
4ed1c54ab2 Tools: Improve identation handling for attribute docstring comments. 2025-03-20 11:07:27 +01:00
tritao
8d36987f16 Base: Remove XML binding files. 2025-03-19 20:04:19 -05:00
tritao
723a25c57d Tools: Re-enable XML comparison mode Python API bindings generator. 2025-03-19 08:32:06 -05:00
Chris Hennes
d8ca8766b1 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
486fb593db Tools: Suppress erroneous warnings for GCC 2025-03-06 21:47:50 +01:00
Chris Hennes
4590289e4f 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
7d28636e05 Remove Python-generated bindings comparison against XML-generated version. 2025-03-03 10:22:41 -06:00
Benjamin Nauck
0952d4de63 Use designated initializers and remove zero-initialized fields 2025-03-03 11:02:19 +01:00
Joao Matos
8e7c3e9f2f Tools: Update binding generator. 2025-03-01 16:23:54 +00:00
tritao
8ba573712c 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
8bb8a36012 Tools: Add documentation for the Python-based bindings system. 2025-02-21 13:18:36 +00:00
tritao
adf8e62ec0 Tools: Move bindings generator into generator folder. 2025-02-08 16:11:01 +00:00