-
Notifications
You must be signed in to change notification settings - Fork 7
Ipy v2 #15
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
Ipy v2 #15
Conversation
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.
I think we need a change on action.yml
to support this new "interpreter" mode, and the corresponding updates on the readme file, other than that, it lgtm
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.
Lookin good @chenkasirer thanks for tag me! 🌠 just a tiny missing datatype for RV8.
As mentioned by @gonzalocasas the action (and readme) should be updated to have an additional interpreter otpion where in the workflow there would be:
- uses: compas-dev/compas-actions.ghpython_components@v5
with:
source: components
target: build
interpreter: ipyV8 # or something like this
And the action.yml
would have just another case:
compas-actions.ghpython_components/action.yml
Lines 25 to 41 in 42a8ef4
- name: Launch componentizer | |
run: | | |
if ("${{ inputs.interpreter }}" -eq "cpython") { | |
$command="python" | |
$componentizer="${{ github.action_path }}/componentize_cpy.py" | |
} else { | |
$command="ipy" | |
$componentizer="${{ github.action_path }}/componentize_ipy.py" | |
} | |
$params=$componentizer, "${{ inputs.source }}", "${{ inputs.target }}", "--ghio", "./lib" | |
$prefix="${{ inputs.prefix }}" | |
if( $prefix ) | |
{ | |
$params=$params + "--prefix", "$prefix" | |
} | |
& $command $params | |
shell: pwsh |
componentize_ipy_v2.py
Outdated
brep="2ceb0405-fdfe-403d-a4d6-8786da45fb9d", | ||
geometrybase="c37956f4-d39c-49c7-af71-1e87f8031b26", |
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.
missing cloud datatype for RV8
pointcloud="d73c9fb0-365d-458f-9fb5-f4141399311f",
# this is new in Rhino8, istead of setting the code as a string, we set it as a base64 blob | ||
script = ghpython_root.CreateChunk("Script") | ||
code_base64 = base64.b64encode(code.encode("utf-8")) | ||
code_base64 = str(code_base64) | ||
script.SetString("Text", code_base64) | ||
script.SetString("Title", "IPy2") | ||
language_spec = script.CreateChunk("LanguageSpec") | ||
language_spec.SetString("Taxon", "*.ironpython.python") | ||
language_spec.SetString("Version", "2.*") |
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.
super nice!
@9and3 thanks so much for taking a look! What do we think about |
@gonzalocasas @9and3 btw in the course of making this I made a small script which unpacks a compiled component and writes it as XML + code as python. it was really helpful to find out what I was doing wrong. Not sure where to put it so made a gist: https://gist.github.com/chenkasirer/986edeb23f8e9ce6cf34fb0d4eb7ff9e |
That's great!!! |
Shouldn't we use the legacy keyword to identify the old stuff like rhino does? ie |
indeed! |
I like this suggestion. |
@gonzalocasas @9and3 so what do we say? I think we should leave the default behavior to be the legacy one to not break Rhino7 compatibility (this action is used directly from |
Sorry, I forgot about this. There's been additional changes and decisions on this topic. What do we do with this PR? Is it still relevant? |
i vote, move forward and don't look back :) |
yeah this seemed like a good idea back then, but now I'm not sure why you'd want to do your GH plugin using ironpython, especially since that r syntax thingy doesn't really work there. we could merge this as it is, and if someone really want they can make rhino8 ipy comonents, otherwise everything else stays the same. or we could also scrap this, my eyes are on cpython atm. |
Don't look back sounds great to me. Time to plan a COMPAS 3.x release entirely dropping IPY support across the board? |
amen |
👍 go for it! |
Yet another copy of the componentizer script, this one is almost identical with the new CPython one but compiles components as for the new IronPython interpreter of Rhino8.
Necessary changes are visible in 42a8ef4
@9and3 couldn't add you as reviewer, but would be great if you could have a look.
One thing I noticed is Rhino8 seems to be taking the input/output argument names from the metadata and replaces the
RunScript
args with them. This means that if argument names are different in the script itself (e.g.Centerline
vs.centerline
) the script will be broken..It would be nice not to have to change components to match, but I currently don't see any other way..