From 762ce7231547b13928b6ae6814c730df17edc1d9 Mon Sep 17 00:00:00 2001 From: Andrea Settimi Date: Tue, 16 Jan 2024 21:42:02 +0100 Subject: [PATCH] WIP: testing action for pycompon --- .github/actions/ghpython-components/action.yml | 2 +- .github/actions/ghpython-components/componentize.py | 6 ++---- .github/workflows/build-components.yml | 8 ++++++-- components/Test_KitchenSink/metadata.json | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/actions/ghpython-components/action.yml b/.github/actions/ghpython-components/action.yml index 2649c0a..1fd6a18 100644 --- a/.github/actions/ghpython-components/action.yml +++ b/.github/actions/ghpython-components/action.yml @@ -18,7 +18,7 @@ runs: - run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json shell: pwsh - run: | - $command="ipy" + $command="python" $params="${{ github.action_path }}/componentize.py", "${{ inputs.source }}", "${{ inputs.target }}", "--ghio", "./lib" $prefix="${{ inputs.prefix }}" if( $prefix ) diff --git a/.github/actions/ghpython-components/componentize.py b/.github/actions/ghpython-components/componentize.py index d737904..364984d 100644 --- a/.github/actions/ghpython-components/componentize.py +++ b/.github/actions/ghpython-components/componentize.py @@ -1,5 +1,3 @@ -from __future__ import print_function - import argparse import base64 import json @@ -7,9 +5,9 @@ import re import sys import tempfile -import urllib +import urllib.request, urllib.parse, urllib.error import zipfile -import StringIO +from io import StringIO import clr import System diff --git a/.github/workflows/build-components.yml b/.github/workflows/build-components.yml index bc0687d..013a555 100644 --- a/.github/workflows/build-components.yml +++ b/.github/workflows/build-components.yml @@ -9,9 +9,13 @@ jobs: - uses: actions/checkout@v2 - uses: NuGet/setup-nuget@v1.0.5 - - name: Install IronPython + - name: Install Python and netpython + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install netpython run: | - choco install ironpython --version=2.7.8.1 + pip install netpython - uses: ./.github/actions/ghpython-components with: source: components diff --git a/components/Test_KitchenSink/metadata.json b/components/Test_KitchenSink/metadata.json index 0974e77..42378ae 100644 --- a/components/Test_KitchenSink/metadata.json +++ b/components/Test_KitchenSink/metadata.json @@ -56,9 +56,9 @@ ], "outputParameters": [ { - "name": "result", - "nickname": "result", - "description": "Result of the computation", + "name": "out", + "nickname": "out", + "description": "output of the computation", "optional": false, "sourceCount": 0, "graft": true