Skip to content

Commit

Permalink
Bump kittycad from 0.6.21 to 0.6.24 (#329)
Browse files Browse the repository at this point in the history
* 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] <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* format

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* fixes

Signed-off-by: Jess Frazelle <[email protected]>

* Updating script outputs

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent c45a95e commit cc4ac94
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 58 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: [1.18]
test-path:
Expand Down Expand Up @@ -70,6 +71,7 @@ jobs:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
test-path:
Expand Down Expand Up @@ -119,6 +121,7 @@ jobs:
build-test-js-versions:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20]
test-path:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -181,6 +185,7 @@ jobs:
needs: [build-test-python-versions]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kittycad==0.6.21
kittycad==0.7.0
2 changes: 1 addition & 1 deletion samples/convert_file/convert_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion tutorials/beginner_tutorial/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tutorials/conversion_obj_step/conversion_obj_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion tutorials/conversion_obj_step/output.step
Git LFS file not shown
2 changes: 1 addition & 1 deletion tutorials/conversion_obj_stl/conversion_obj_stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion tutorials/getting_started/getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
26 changes: 13 additions & 13 deletions tutorials/import_file/import_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
default_camera_focus_on,
import_files,
take_snapshot,
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():
Expand All @@ -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(
import_files(
OptionImportFiles(
files=[ImportFile(data=content, path=file_name)],
format=InputFormat(
obj(
OptionObj(
units=UnitLength.M,
coords=System(
forward=AxisDirectionPair(
Expand Down Expand Up @@ -103,8 +103,8 @@ def test_ws_import():
cmd_id = uuid.uuid4()
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(default_camera_focus_on(uuid=object_id)),
OptionModelingCmdReq(
cmd=ModelingCmd(OptionDefaultCameraFocusOn(uuid=object_id)),
cmd_id=ModelingCmdId(cmd_id),
)
)
Expand All @@ -127,8 +127,8 @@ def test_ws_import():
cmd_id = uuid.uuid4()
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)),
OptionModelingCmdReq(
cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)),
cmd_id=ModelingCmdId(cmd_id),
)
)
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tutorials/text-to-cad/text-to-cad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
2 changes: 1 addition & 1 deletion tutorials/websocket_tutorial/10_sample.py.part
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
):
png_contents = message_dict["resp"]["data"]["modeling_response"][
"data"
]["contents"].get_decoded()
]["contents"]
break

# Save the contents to a file.
Expand Down
1 change: 0 additions & 1 deletion tutorials/websocket_tutorial/draw_cube_rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
67 changes: 35 additions & 32 deletions tutorials/websocket_tutorial/websocketexample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
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
from kittycad.models.path_segment import OptionLine
from kittycad.models.web_socket_request import OptionModelingCmdReq


def make_cube():
Expand All @@ -41,17 +41,18 @@ def make_cube():
# Start the Path
websocket.send(
WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(sketch_path_id)
OptionModelingCmdReq(
cmd=ModelingCmd(OptionStartPath()),
cmd_id=ModelingCmdId(sketch_path_id),
),
)
)

websocket.send(
WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
cmd=ModelingCmd(
move_path_pen(
OptionMovePathPen(
path=str(sketch_path_id),
to={
"x": -5,
Expand All @@ -67,11 +68,11 @@ def make_cube():

websocket.send(
WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
cmd=ModelingCmd(
extend_path(
OptionExtendPath(
path=str(sketch_path_id),
segment=line(
segment=OptionLine(
end={
"x": 10,
"y": 0,
Expand All @@ -88,11 +89,11 @@ def make_cube():

websocket.send(
WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
cmd=ModelingCmd(
extend_path(
OptionExtendPath(
path=str(sketch_path_id),
segment=line(
segment=OptionLine(
end={
"x": 0,
"y": 10,
Expand All @@ -109,11 +110,11 @@ def make_cube():

websocket.send(
WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
cmd=ModelingCmd(
extend_path(
OptionExtendPath(
path=str(sketch_path_id),
segment=line(
segment=OptionLine(
end={
"x": -10,
"y": 0,
Expand All @@ -131,19 +132,21 @@ def make_cube():
# Close the sketch
websocket.send(
WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(close_path(path_id=ModelingCmdId(sketch_path_id))),
OptionModelingCmdReq(
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(
OptionModelingCmdReq(
cmd=ModelingCmd(
extrude(
OptionExtrude(
cap=True,
distance=10,
target=ModelingCmdId(sketch_path_id),
Expand All @@ -163,9 +166,9 @@ def make_cube():
# Orient the camera.
websocket.send(
WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
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},
Expand All @@ -179,8 +182,8 @@ def make_cube():
# Take a snapshot.
websocket.send(
WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)),
OptionModelingCmdReq(
cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)),
cmd_id=ModelingCmdId(uuid.uuid4()),
)
)
Expand All @@ -196,7 +199,7 @@ def make_cube():
):
png_contents = message_dict["resp"]["data"]["modeling_response"][
"data"
]["contents"].get_decoded()
]["contents"]
break

# Save the contents to a file.
Expand Down

0 comments on commit cc4ac94

Please sign in to comment.