Skip to content

Conversation

@bakpaul
Copy link
Contributor

@bakpaul bakpaul commented Sep 19, 2024

At first I wanted to make it auto generated in the CMake project, to have a well integrated workflow in the build. I tried in many ways :

  1. Tried to do it during the build (see first commit). But because ninja offers no guaranty over the dependency effective termination (see https://cmake.org/cmake/help/latest/command/add_dependencies.html#command:add_dependencies) it doesn't work.
  2. Tried to do it through a add_custom_command but it isn't possible because the targets SofaPython3 and Bindings are Interfaces.
  3. Also tried to do it during the install process which is a nightmare because the installation order isn't ordered.

So back to the weak solution, a script that needs to be run by hands. I'll really enjoy adding it to Jenkins...

@fredroy fredroy force-pushed the add_stubgen_autogeneration branch from 8653620 to 13ba8e9 Compare November 6, 2024 09:45
Copy link
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the script generate_stubs to be written in Python. It would more readable and cross-platform.

@fredroy fredroy merged commit 9d01d90 into sofa-framework:master Jan 8, 2025
4 checks passed
bakpaul added a commit that referenced this pull request Jan 8, 2025
* Add stubgen auto generaiton after bindings build

* Generating stubs through cmake does not work as expected with ninja with a in build startegy and isnt working in install because the install order is random

* fix missing quote

* Add python path for stubgen

* Try to find out what is wrong when generating

* Change script to python , add Sofa.Component generation and allow the use of either pybind11 or mypy

* fix action

* try fix env for stubgen

* try fix action

* Add env for SOFA libs

* Remove output

* Add echot osee line

* Add more informaiton

* Fix python script

* Try fix unit tests

* Fix mistake in split

* add filter to skip synchronizing files that already exist in dest folder. This should be removed once create_sofa_stubs is able to merge the generated stubs with existing implementation

* Fix windows stubgen by printing a warning instead of throwing an exception when input type is unknown

* Fix warning print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr: status ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants