diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f2e8e5..d1a8511 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: - name: Extract functionInputSchema id: extract_schema run: | - python src/main.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }} + python run.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }} - name: Speckle Automate Function - Build and Publish uses: specklesystems/speckle-automate-github-composite-action@0.8.1 with: @@ -35,6 +35,6 @@ jobs: speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }} speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }} speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }} - speckle_function_command: 'python -u src/main.py run' + speckle_function_command: 'python -u run.py run' speckle_function_recommended_cpu_m: 4000 speckle_function_recommended_memory_mi: 4000 diff --git a/run.py b/run.py new file mode 100644 index 0000000..f019d8f --- /dev/null +++ b/run.py @@ -0,0 +1,13 @@ +from speckle_automate import execute_automate_function +import sys +from pathlib import Path + +# Add src to the sys.path +src_path = Path(__file__).resolve().parent / 'src' +sys.path.append(str(src_path)) + +from src.main import automate_function, FunctionInputs + +if __name__ == "__main__": + # Entry point: Execute the automate function with defined inputs. + execute_automate_function(automate_function, FunctionInputs) diff --git a/src/main.py b/src/main.py index cd888b8..0575490 100644 --- a/src/main.py +++ b/src/main.py @@ -15,12 +15,6 @@ from objects.objects import ( from src.utilities.reporting import generate_pdf, write_pdf_to_temp, generate_summary from src.utilities.utilities import filter_displayable_bases - -## new render materials for objects passing/failing -## swap those into the original commit object -## send that back to the server - - class FunctionInputs(AutomateBase): """Definition of user inputs for this function. @@ -139,8 +133,3 @@ def automate_function( automate_context.mark_run_success( "Analysis complete. High-density objects within acceptable limits." ) - - -if __name__ == "__main__": - # Entry point: Execute the automate function with defined inputs. - execute_automate_function(automate_function, FunctionInputs)