Closed jpirnay closed 6 months ago
This PR reverts Python 3.8+ syntax (specifically the walrus operator ':=') to make the code compatible with Python 3.6, which is needed for Raspberry Pi 32-bit builds. The changes primarily involve restructuring conditional assignments into separate statements.
graph TD;
A[GitHub Actions] -->|Triggers| B[Unittest Workflow];
B -->|Runs on| C[Windows 2019];
B -->|Python Version| D[Python 3.6];
B --> E[Checkout Code];
B --> F[Setup Python];
B --> G[Cache Python Environment];
B --> H[Install Dependencies];
B --> I[List Environment];
B --> J[Run Unittests];
subgraph Workflow Steps
E --> F --> G --> H --> I --> J
end
classDiagram
class OpCut {
+add_reference(node, pos, kwargs)
-valid_node_for_reference(node)
-_children
}
class OpEngrave {
+add_reference(node, pos, kwargs)
-valid_node_for_reference(node)
-_children
}
class ImageProperty {
+update_image()
+calculate_contours()
-node
-matrix
-parameters
}
class Wxmtree {
+refresh_tree(node, level, source)
-elements
-wxtree
}
class Wxutils {
+set_color_according_to_theme(control, background, foreground)
}
note for OpCut "Reverted walrus operator in add_reference method"
note for OpEngrave "Reverted walrus operator in add_reference method"
note for ImageProperty "Reverted walrus operator in update_image and calculate_contours methods"
note for Wxmtree "Reverted walrus operator in refresh_tree method"
note for Wxutils "Reverted walrus operator in set_color_according_to_theme method"
Change | Details | Files |
---|---|---|
Replace walrus operator assignments with traditional assignment statements |
|
meerk40t/core/node/op_cut.py meerk40t/core/node/op_engrave.py meerk40t/gui/propertypanels/imageproperty.py meerk40t/gui/wxmtree.py meerk40t/gui/wxutils.py |
Add Python 3.6 specific CI workflow |
|
.github/workflows/unittest-py36.yml |
We still need Python 3.6 for Raspberry Pi 32 bit compiles - the walrus operator (if-assignment
if flag:=condition:
) has been introduced with python 3.8 and is hence unsupported.Summary by Sourcery
Revert Python code to remove the walrus operator for compatibility with Python 3.6 and add a CI workflow to run unittests on Python 3.6.
Bug Fixes:
CI: