compas-actions.ghpython_components icon indicating copy to clipboard operation
compas-actions.ghpython_components copied to clipboard

Ipy v2

Open chenkasirer opened this issue 1 year ago • 6 comments

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 https://github.com/compas-dev/compas-actions.ghpython_components/commit/42a8ef452828eb591b7bb4e8ed1f8c13e8959155

@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..

chenkasirer avatar Sep 05 '24 14:09 chenkasirer

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:

https://github.com/compas-dev/compas-actions.ghpython_components/blob/42a8ef452828eb591b7bb4e8ed1f8c13e8959155/action.yml#L25-L41

@9and3 thanks so much for taking a look! I missed a bunch of guids that changes etc, but I think I got it right now.

What do we think about ipy_v2 instead of ipyV8? I tend to like ipy_v2 better..

chenkasirer avatar Sep 13 '24 16:09 chenkasirer

@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

chenkasirer avatar Sep 13 '24 17:09 chenkasirer

@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!!!

gonzalocasas avatar Sep 13 '24 17:09 gonzalocasas

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:

https://github.com/compas-dev/compas-actions.ghpython_components/blob/42a8ef452828eb591b7bb4e8ed1f8c13e8959155/action.yml#L25-L41

@9and3 thanks so much for taking a look! I missed a bunch of guids that changes etc, but I think I got it right now.

What do we think about ipy_v2 instead of ipyV8? I tend to like ipy_v2 better..

Shouldn't we use the legacy keyword to identify the old stuff like rhino does? ie cpython and ironpython for the new editor and ironpython_legacy for the old one?

gonzalocasas avatar Sep 13 '24 17:09 gonzalocasas

Shouldn't we use the legacy keyword to identify the old stuff like rhino does? ie cpython and ironpython for the new editor and ironpython_legacy for the old one?

indeed!

9and3 avatar Sep 14 '24 10:09 9and3

Shouldn't we use the legacy keyword to identify the old stuff like rhino does? ie cpython and ironpython for the new editor and ironpython_legacy for the old one?

I like this suggestion. What I'm worried about it that it would make IronPython2 components the default that are packaged with releases. These aren't backwards compatible. We need to come up with some mechanism that lets us package all versions with release and lets typical users a way to choose which ones to install (as Rhino7 and 8 share the same component directory, you can really have only one or another installed).

chenkasirer avatar Sep 17 '24 09:09 chenkasirer

@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 main..) Once we have a good strategy of dealing with the different environments we can do this rework.

chenkasirer avatar Oct 03 '24 09:10 chenkasirer

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?

gonzalocasas avatar Jan 29 '25 10:01 gonzalocasas

i vote, move forward and don't look back :)

tomvanmele avatar Jan 29 '25 12:01 tomvanmele

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.

chenkasirer avatar Jan 29 '25 12:01 chenkasirer

Don't look back sounds great to me. Time to plan a COMPAS 3.x release entirely dropping IPY support across the board?

gonzalocasas avatar Jan 29 '25 12:01 gonzalocasas

Don't look back sounds great to me. Time to plan a COMPAS 3.x release entirely dropping IPY support across the board?

amen

chenkasirer avatar Jan 29 '25 12:01 chenkasirer

we could merge this as it is

👍 go for it!

gonzalocasas avatar Jan 29 '25 12:01 gonzalocasas

am keeping this for the COMPAS museum. just in case...

Screenshot 2025-01-29 at 13 52 08

tomvanmele avatar Jan 29 '25 12:01 tomvanmele