-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeCAD stubs #36
Comments
Thanks, but there are so many dirty regex 😃 Actually, the repo started as a quick script to generate helper stubs for my personal usage. Then I read somewhere on the FreeCAD forum about Recently, I started refactoring code to parse the original c++ code (to avoid regex/macros/etc.) and extract the python type using the same heuristics I developed in the regex version.
I believe the best place for stubs is to be together with the c++ code. There were even a few ideas to integrate this code with FreeCAD repo, but I decided to dismiss the decision in time and stabilize code a bit more.
So in a long run, I would be ok, to make this repo archived.
I believe these pieces may be missing when the FreeCAD will start uses stub to generate cpp:
As you can see, there are many small issues that I tried to not bother about it the FreeCAD devs, but probably now it is a good time to fix it. What do you think about each of these points/steps? |
That's a great idea. I have a lot of experience with such an approach (developed https://github.com/mono/CppSharp) along with Clang internals, so let me know if I can provide any assistance. About your other points, thanks very much, this was the kind of details I was looking for. I will investigate in more detail so I can provide more feedback. Do you think it will still beneficial to have libclang-based approach even with the Python stubs being provided directly by FreeCAD? Is there any information that we need from the C++ files that is not in the bindings? I have not looked into everything in detail so I am not sure. But maybe even that was the case maybe it could still be beneficial to have the libclang-based tools to make sure all the signatures are correct? |
I think I would be better to focus on stub first. And later, if we notice we are missing something that cannot be generated, consider scanning cpp code.
Definitely some points from above:
I think that cpp compiler should be good enough to detect most mistakes. |
Hello @ostr00000, thanks for your comment and review in the FreeCAD Pythons bindings PR.
I have been taking a deeper look at your work in this repo and it really is outstanding. 👏
As you're now aware I've also been trying to improve the FreeCAD Python typing situation, went through a slightly different route since I wasn't fully aware of how advanced your work on this repository was, but it's probably for the best as I think the direct typing stubs from the binding stubs has a few advantages.
One of the goals of my work has always been to try and introduce more Python typing into the FreeCAD project code and I believe that requires having a more direct integration in the core.
After the Python interface files are merged into the core, I was going to start looking for the other missing pieces, but you seem to have taken care of such things here already.
At this point I am wondering if when we introduce such Python stubs in the core, if you think that it should use such files directly at typing stubs or if we should input such files into your pre-existing generator and re-use the same process you have.
Or if you think it could be cleaner to refactor some things in the core to further ease the work of future maintenance and generation of complete and accurate typings.
So overall I think it could be very beneficial if we could collaborate on this as you have a lot of experience working on this problem and on the spirit of open-source, would be best to continue from all the great work you have done here.
The text was updated successfully, but these errors were encountered: