From d01f9dc5e9247e0c7fa116b5e81810c248e4da93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:42:40 +0000 Subject: [PATCH 01/12] Bump kittycad from 0.6.21 to 0.6.24 Bumps kittycad from 0.6.21 to 0.6.24. --- updated-dependencies: - dependency-name: kittycad dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index edfb546..af5dfed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -kittycad==0.6.21 +kittycad==0.6.24 From fd65848906af4f483b2a780d9b11ba51f25e746c Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 15:52:09 -0700 Subject: [PATCH 02/12] fixes Signed-off-by: Jess Frazelle --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index af5dfed..5de8fe5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -kittycad==0.6.24 +kittycad==0.7.0 From 44c9ce04359cbb717c0a89be21c8ec509d189cf3 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 15:53:45 -0700 Subject: [PATCH 03/12] updates Signed-off-by: Jess Frazelle --- .github/workflows/build-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 563e069..5851cbe 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -36,6 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: go-version: [1.18] test-path: @@ -70,6 +71,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: [3.9] test-path: @@ -119,6 +121,7 @@ jobs: build-test-js-versions: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node: [20] test-path: @@ -152,6 +155,7 @@ jobs: build-test-rs-versions: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: test-path: - ./tutorials/websocket_tutorial/draw_cube_rust @@ -181,6 +185,7 @@ jobs: needs: [build-test-python-versions] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: [3.9] steps: From ddf1284d8cd316a3679a2ee878cf417061b40f5c Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 15:57:04 -0700 Subject: [PATCH 04/12] fixes Signed-off-by: Jess Frazelle --- samples/convert_file/convert_file.py | 2 +- tutorials/beginner_tutorial/convert.py | 2 +- tutorials/conversion_obj_step/conversion_obj_step.py | 2 +- tutorials/conversion_obj_stl/conversion_obj_stl.py | 2 +- tutorials/getting_started/getting_started.py | 2 +- tutorials/import_file/import_model.py | 2 +- tutorials/text-to-cad/text-to-cad.py | 2 +- tutorials/websocket_tutorial/10_sample.py.part | 2 +- tutorials/websocket_tutorial/websocketexample.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/convert_file/convert_file.py b/samples/convert_file/convert_file.py index 6c5c212..e514b6d 100755 --- a/samples/convert_file/convert_file.py +++ b/samples/convert_file/convert_file.py @@ -54,5 +54,5 @@ output_file_path = "./output.stl" print(f"Saving output to {output_file_path}") output_file = open(output_file_path, "wb") - output_file.write(output.get_decoded()) + output_file.write(output) output_file.close() diff --git a/tutorials/beginner_tutorial/convert.py b/tutorials/beginner_tutorial/convert.py index 01ceeed..fd792f0 100644 --- a/tutorials/beginner_tutorial/convert.py +++ b/tutorials/beginner_tutorial/convert.py @@ -43,7 +43,7 @@ def convertOBJtoSTL(): output_file_path = "./dodecahedron.stl" print(f"Saving output to {output_file_path}") output_file = open(output_file_path, "wb") - output_file.write(output.get_decoded()) + output_file.write(output) output_file.close() return body diff --git a/tutorials/conversion_obj_step/conversion_obj_step.py b/tutorials/conversion_obj_step/conversion_obj_step.py index fe16621..99afdd3 100755 --- a/tutorials/conversion_obj_step/conversion_obj_step.py +++ b/tutorials/conversion_obj_step/conversion_obj_step.py @@ -53,5 +53,5 @@ output_file_path = "./output.step" print(f"Saving output to {output_file_path}") output_file = open(output_file_path, "wb") - output_file.write(output.get_decoded()) + output_file.write(output) output_file.close() diff --git a/tutorials/conversion_obj_stl/conversion_obj_stl.py b/tutorials/conversion_obj_stl/conversion_obj_stl.py index 87cd167..812243a 100755 --- a/tutorials/conversion_obj_stl/conversion_obj_stl.py +++ b/tutorials/conversion_obj_stl/conversion_obj_stl.py @@ -54,5 +54,5 @@ output_file_path = "./output.stl" print(f"Saving output to {output_file_path}") output_file = open(output_file_path, "wb") - output_file.write(output.get_decoded()) + output_file.write(output) output_file.close() diff --git a/tutorials/getting_started/getting_started.py b/tutorials/getting_started/getting_started.py index d3a2fcc..5c786c9 100755 --- a/tutorials/getting_started/getting_started.py +++ b/tutorials/getting_started/getting_started.py @@ -55,5 +55,5 @@ output_file_path = "./output.stl" print(f"Saving output to {output_file_path}") output_file = open(output_file_path, "wb") - output_file.write(output.get_decoded()) + output_file.write(output) output_file.close() diff --git a/tutorials/import_file/import_model.py b/tutorials/import_file/import_model.py index 84d0025..ba7a179 100644 --- a/tutorials/import_file/import_model.py +++ b/tutorials/import_file/import_model.py @@ -154,7 +154,7 @@ def test_ws_import(): # Break since now we know it was a success. png_contents = message_dict["resp"]["data"]["modeling_response"][ "data" - ]["contents"].get_decoded() + ]["contents"] break # Save the contents to a file. diff --git a/tutorials/text-to-cad/text-to-cad.py b/tutorials/text-to-cad/text-to-cad.py index de83024..fef3392 100644 --- a/tutorials/text-to-cad/text-to-cad.py +++ b/tutorials/text-to-cad/text-to-cad.py @@ -42,5 +42,5 @@ # Save the STEP data as text-to-cad-output.step final_result = response.outputs["source.step"] with open("text-to-cad-output.step", "w", encoding="utf-8") as output_file: - output_file.write(final_result.get_decoded().decode("utf-8")) + output_file.write(final_result.decode("utf-8")) print(f"Saved output to {output_file.name}") diff --git a/tutorials/websocket_tutorial/10_sample.py.part b/tutorials/websocket_tutorial/10_sample.py.part index 1a4c8d6..8e4578e 100644 --- a/tutorials/websocket_tutorial/10_sample.py.part +++ b/tutorials/websocket_tutorial/10_sample.py.part @@ -9,7 +9,7 @@ ): png_contents = message_dict["resp"]["data"]["modeling_response"][ "data" - ]["contents"].get_decoded() + ]["contents"] break # Save the contents to a file. diff --git a/tutorials/websocket_tutorial/websocketexample.py b/tutorials/websocket_tutorial/websocketexample.py index 50392b3..756b48b 100644 --- a/tutorials/websocket_tutorial/websocketexample.py +++ b/tutorials/websocket_tutorial/websocketexample.py @@ -196,7 +196,7 @@ def make_cube(): ): png_contents = message_dict["resp"]["data"]["modeling_response"][ "data" - ]["contents"].get_decoded() + ]["contents"] break # Save the contents to a file. From 9b08312cb60ce6ff0fbcc8ee3d6ae94ae8ea1f88 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:00:01 -0700 Subject: [PATCH 05/12] fixes Signed-off-by: Jess Frazelle --- .../websocket_tutorial/websocketexample.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tutorials/websocket_tutorial/websocketexample.py b/tutorials/websocket_tutorial/websocketexample.py index 756b48b..19ca8f9 100644 --- a/tutorials/websocket_tutorial/websocketexample.py +++ b/tutorials/websocket_tutorial/websocketexample.py @@ -6,13 +6,13 @@ from kittycad.client import ClientFromEnv from kittycad.models import ImageFormat, ModelingCmd, ModelingCmdId, WebSocketRequest from kittycad.models.modeling_cmd import ( - close_path, - default_camera_look_at, - extend_path, - extrude, - move_path_pen, - start_path, - take_snapshot, + OptionClosePath, + OptionDefaultCameraLookAt, + OptionExtendPath, + OptionExtrude, + OptionMovePathPen, + OptionStartPath, + OptionTakeSnapshot, ) from kittycad.models.path_segment import line from kittycad.models.web_socket_request import modeling_cmd_req @@ -42,7 +42,7 @@ def make_cube(): websocket.send( WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(sketch_path_id) + cmd=ModelingCmd(OptionStartPath()), cmd_id=ModelingCmdId(sketch_path_id) ), ) ) @@ -51,7 +51,7 @@ def make_cube(): WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - move_path_pen( + OptionMovePathPen( path=str(sketch_path_id), to={ "x": -5, @@ -69,7 +69,7 @@ def make_cube(): WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - extend_path( + OptionExtendPath( path=str(sketch_path_id), segment=line( end={ @@ -90,7 +90,7 @@ def make_cube(): WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - extend_path( + OptionExtendPath( path=str(sketch_path_id), segment=line( end={ @@ -111,7 +111,7 @@ def make_cube(): WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - extend_path( + OptionExtendPath( path=str(sketch_path_id), segment=line( end={ @@ -132,18 +132,18 @@ def make_cube(): websocket.send( WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(close_path(path_id=ModelingCmdId(sketch_path_id))), + cmd=ModelingCmd(OptionClosePath(path_id=ModelingCmdId(sketch_path_id))), cmd_id=ModelingCmdId(uuid.uuid4()), ) ) ) - # Extrude the square into a cube + # OptionExtrude the square into a cube websocket.send( WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - extrude( + OptionExtrude( cap=True, distance=10, target=ModelingCmdId(sketch_path_id), @@ -165,7 +165,7 @@ def make_cube(): WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - default_camera_look_at( + OptionDefaultCameraLookAt( center={"x": 0, "y": 0, "z": 0}, up={"x": 0, "y": 0, "z": 1}, vantage={"x": 20, "y": 20, "z": 20}, @@ -180,7 +180,7 @@ def make_cube(): websocket.send( WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)), + cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)), cmd_id=ModelingCmdId(uuid.uuid4()), ) ) From 2653051ff0aef7b01547c463f6220d1f9e590850 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:00:40 -0700 Subject: [PATCH 06/12] fixes Signed-off-by: Jess Frazelle --- tutorials/websocket_tutorial/draw_cube_rust/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tutorials/websocket_tutorial/draw_cube_rust/src/main.rs b/tutorials/websocket_tutorial/draw_cube_rust/src/main.rs index 5bebef5..8d05489 100644 --- a/tutorials/websocket_tutorial/draw_cube_rust/src/main.rs +++ b/tutorials/websocket_tutorial/draw_cube_rust/src/main.rs @@ -142,7 +142,6 @@ async fn draw_cube( write_to_ws .send(to_msg( ModelingCmd::Extrude { - cap: true, distance: width * 2.0, target: path_id, }, From c400ec588bcfbeca332f5d5e3beae50d57e57b33 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:01:19 -0700 Subject: [PATCH 07/12] format Signed-off-by: Jess Frazelle --- tutorials/websocket_tutorial/websocketexample.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tutorials/websocket_tutorial/websocketexample.py b/tutorials/websocket_tutorial/websocketexample.py index 19ca8f9..2a6ecb8 100644 --- a/tutorials/websocket_tutorial/websocketexample.py +++ b/tutorials/websocket_tutorial/websocketexample.py @@ -42,7 +42,8 @@ def make_cube(): websocket.send( WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(OptionStartPath()), cmd_id=ModelingCmdId(sketch_path_id) + cmd=ModelingCmd(OptionStartPath()), + cmd_id=ModelingCmdId(sketch_path_id), ), ) ) @@ -132,7 +133,9 @@ def make_cube(): websocket.send( WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(OptionClosePath(path_id=ModelingCmdId(sketch_path_id))), + cmd=ModelingCmd( + OptionClosePath(path_id=ModelingCmdId(sketch_path_id)) + ), cmd_id=ModelingCmdId(uuid.uuid4()), ) ) From 3e270a9d228131a5a4633a28e67c4cbe33256e09 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:04:01 -0700 Subject: [PATCH 08/12] fixes Signed-off-by: Jess Frazelle --- tutorials/import_file/import_model.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tutorials/import_file/import_model.py b/tutorials/import_file/import_model.py index ba7a179..67e2e79 100644 --- a/tutorials/import_file/import_model.py +++ b/tutorials/import_file/import_model.py @@ -18,9 +18,9 @@ ) from kittycad.models.input_format import obj from kittycad.models.modeling_cmd import ( - default_camera_focus_on, - import_files, - take_snapshot, + OptionDefaultCameraFocusOn, + OptionImportFiles, + OptionTakeSnapshot, ) from kittycad.models.web_socket_request import modeling_cmd_req @@ -51,7 +51,7 @@ def test_ws_import(): req = WebSocketRequest( modeling_cmd_req( cmd=ModelingCmd( - import_files( + OptionImportFiles( files=[ImportFile(data=content, path=file_name)], format=InputFormat( obj( @@ -104,7 +104,7 @@ def test_ws_import(): # form the request req = WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(default_camera_focus_on(uuid=object_id)), + cmd=ModelingCmd(OptionDefaultCameraFocusOn(uuid=object_id)), cmd_id=ModelingCmdId(cmd_id), ) ) @@ -128,7 +128,7 @@ def test_ws_import(): # form the request req = WebSocketRequest( modeling_cmd_req( - cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)), + cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)), cmd_id=ModelingCmdId(cmd_id), ) ) From 8a077662078c796c580816f8eb73e149708d6f04 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:04:58 -0700 Subject: [PATCH 09/12] fixes Signed-off-by: Jess Frazelle --- .github/workflows/python-format.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-format.yml b/.github/workflows/python-format.yml index 0cc8d0f..a5b3d7c 100644 --- a/.github/workflows/python-format.yml +++ b/.github/workflows/python-format.yml @@ -27,7 +27,7 @@ jobs: run: | pip install isort ruff black isort . */*/*.py - black . */*/*.py + ruff format ruff check --fix . */*/*.py - name: Check for modified files @@ -41,5 +41,5 @@ jobs: git config --local user.name "github-actions[bot]" git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git fetch origin - git commit -am "LOOK ON MY REFORMAT, YE MIGHTY, AND DESPAIR!" - git push origin ${{github.event.pull_request.head.ref }} + git commit -am "LOOK ON MY REFORMAT, YE MIGHTY, AND DESPAIR!" || true + git push origin ${{github.event.pull_request.head.ref }} || true From 6cab9d7c2f6eeb5876971617129da311351f83df Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:07:22 -0700 Subject: [PATCH 10/12] fixes Signed-off-by: Jess Frazelle --- .../websocket_tutorial/websocketexample.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tutorials/websocket_tutorial/websocketexample.py b/tutorials/websocket_tutorial/websocketexample.py index 2a6ecb8..845f427 100644 --- a/tutorials/websocket_tutorial/websocketexample.py +++ b/tutorials/websocket_tutorial/websocketexample.py @@ -14,8 +14,8 @@ OptionStartPath, OptionTakeSnapshot, ) -from kittycad.models.path_segment import line -from kittycad.models.web_socket_request import modeling_cmd_req +from kittycad.models.path_segment import OptionLine +from kittycad.models.web_socket_request import OptionModelingCmdReq def make_cube(): @@ -41,7 +41,7 @@ def make_cube(): # Start the Path websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd(OptionStartPath()), cmd_id=ModelingCmdId(sketch_path_id), ), @@ -50,7 +50,7 @@ def make_cube(): websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionMovePathPen( path=str(sketch_path_id), @@ -68,11 +68,11 @@ def make_cube(): websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionExtendPath( path=str(sketch_path_id), - segment=line( + segment=OptionLine( end={ "x": 10, "y": 0, @@ -89,11 +89,11 @@ def make_cube(): websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionExtendPath( path=str(sketch_path_id), - segment=line( + segment=OptionLine( end={ "x": 0, "y": 10, @@ -110,11 +110,11 @@ def make_cube(): websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionExtendPath( path=str(sketch_path_id), - segment=line( + segment=OptionLine( end={ "x": -10, "y": 0, @@ -132,7 +132,7 @@ def make_cube(): # Close the sketch websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionClosePath(path_id=ModelingCmdId(sketch_path_id)) ), @@ -144,7 +144,7 @@ def make_cube(): # OptionExtrude the square into a cube websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionExtrude( cap=True, @@ -166,7 +166,7 @@ def make_cube(): # Orient the camera. websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionDefaultCameraLookAt( center={"x": 0, "y": 0, "z": 0}, @@ -182,7 +182,7 @@ def make_cube(): # Take a snapshot. websocket.send( WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)), cmd_id=ModelingCmdId(uuid.uuid4()), ) From 31cdbd04cec700913fc856a2af1384b66f7dd78c Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 10 Sep 2024 16:08:30 -0700 Subject: [PATCH 11/12] fixes Signed-off-by: Jess Frazelle --- tutorials/import_file/import_model.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tutorials/import_file/import_model.py b/tutorials/import_file/import_model.py index 67e2e79..b428c74 100644 --- a/tutorials/import_file/import_model.py +++ b/tutorials/import_file/import_model.py @@ -16,13 +16,13 @@ UnitLength, WebSocketRequest, ) -from kittycad.models.input_format import obj +from kittycad.models.input_format import OptionObj from kittycad.models.modeling_cmd import ( OptionDefaultCameraFocusOn, OptionImportFiles, OptionTakeSnapshot, ) -from kittycad.models.web_socket_request import modeling_cmd_req +from kittycad.models.web_socket_request import OptionModelingCmdReq def test_ws_import(): @@ -49,12 +49,12 @@ def test_ws_import(): ImportFile(data=content, path=file_name) # form the request req = WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd( OptionImportFiles( files=[ImportFile(data=content, path=file_name)], format=InputFormat( - obj( + OptionObj( units=UnitLength.M, coords=System( forward=AxisDirectionPair( @@ -103,7 +103,7 @@ def test_ws_import(): cmd_id = uuid.uuid4() # form the request req = WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd(OptionDefaultCameraFocusOn(uuid=object_id)), cmd_id=ModelingCmdId(cmd_id), ) @@ -127,7 +127,7 @@ def test_ws_import(): cmd_id = uuid.uuid4() # form the request req = WebSocketRequest( - modeling_cmd_req( + OptionModelingCmdReq( cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)), cmd_id=ModelingCmdId(cmd_id), ) From 025709883e3e4eb8f60d2ab854b8af8b259454d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Sep 2024 23:09:42 +0000 Subject: [PATCH 12/12] Updating script outputs --- tutorials/conversion_obj_step/output.step | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/conversion_obj_step/output.step b/tutorials/conversion_obj_step/output.step index 292ca4e..50df27a 100644 --- a/tutorials/conversion_obj_step/output.step +++ b/tutorials/conversion_obj_step/output.step @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9985128010fd234154fd7f0580ef86690c60201691a7047d004761537c4b9fd2 +oid sha256:2bc33baf070b1bd4ddf5021181e834def6fe8c61f5ec724fd72611f270e270bb size 505853