-
Notifications
You must be signed in to change notification settings - Fork 8
Porting action workflow to Python 3.9.10 (ScriptComponent in V8) #13
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
Conversation
gonzalocasas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! This is super cool!
I added a bunch of comments. And there's one thing I'd like to request to change: it might be better for a smoother migration of users already using this action, that we don't remove the support for iropython, but instead add support for cpython, It could be as simple as reverting the changes on componentize.py and creating a componentize-cpytyhon.py with the new support for py3. Then, I guess the action.yml will need to determine which one to run based on some input.
So, by default, this action could still do ironpython, but passing a param, it could switch to build py3 components.
| Returns: | ||
| result: The sum of all three values. | ||
| """ | ||
| from ghpythonlib.componentbase import executingcomponent as component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the legacy ghscript component has a VERY strange internal logic that depends on the class of the component inheriting from something called component. Rhino checked this using a string comparison, not type checking. That's the reason why executingcomponent is renamed here. Is this silly thing still true for the new script component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm I see. I tried with inheritance directly from executingcomponent and the ghenv.Component.Message stops working although the ghuser component can be built and added to the canvas. If I go back to component everything works as expected.
also @gonzalocasas : I do not know if it is connected but the SDK mode is not working anymore since this was a feature of the old ghpython component to activate with IsAdvancedMode set to True. To my limited extent of knowledge of the new ScriptComponent there is no such feature.
thanks! I am going through them.
Got it. I'll give it a go! |
|
Hello! I added the dual functioning of the - uses: compas-dev/compas-actions.ghpython_components@v2
with:
source: components
target: build
interpreter: cpython # optional, defaults to ironpythonI tried to update the readme and add two jobs in the Let me know if there is something to modify! |
gonzalocasas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking great! I added some small feedback, after addressing those, we can merge!
|
Done! I tested it again and all is good from my side. Thanks @gonzalocasas for the feedback, this super nice workflow and for compas y'all🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! I'm merging this, updating docs to reference a new v3 v5 release, and releasing it! Thanks a lot!
Hello!
This is the first working draft to port the compas action componentizer workflow to Python 3.x. in Grasshopper v8 (see issue #12). I tested it in CI and on other local projects and it works well, but I can't promise it to be fully bug free :) Looking forward to recive feedback to integrate and thanks again for this great workflow! 🙏
🐍🐍🐍
changelog
Scriptlogic incomponentizer.pymetadata.jsonis cleaned off the ironpython outdated entries in the serialization and updated with the new onesdiscussions
outparameter is not shown by default. Especially now with the new ScriptComponent it seems that theproblemtab is taking up its role. As a python coder in Rhino I am kinda affectionate to it, so maybe it could be set as an option inmetadata.jsonto wether or not showing it in the component (?).