Skip to content

Commit d1e4cb6

Browse files
Try OCP 7.8.1 (#1589)
* Try OCP 7.8.1 * Update meta.yaml * Fix hash * Update vis.py * Update vis.py * Update appveyor.yml * Run only tests/test_exporters.py * Fix pytest invocation * typo fix * Reenable all tests * Reenable mypy * Skip mypy again * Use released ocp * Reenable mypy * mypy fixes/workarounds for vtk * Update setup.py fro 7.8.1
1 parent b8370dd commit d1e4cb6

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

cadquery/occ_impl/shapes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@
300300
Real = Union[float, int]
301301

302302
TOLERANCE = 1e-6
303-
HASH_CODE_MAX = 2147483647 # max 32bit signed int, required by OCC.Core.HashCode
304303

305304
shape_LUT = {
306305
ta.TopAbs_VERTEX: "Vertex",
@@ -596,7 +595,7 @@ def hashCode(self) -> int:
596595
Returns a hashed value denoting this shape. It is computed from the
597596
TShape and the Location. The Orientation is not used.
598597
"""
599-
return self.wrapped.HashCode(HASH_CODE_MAX)
598+
return hash(self.wrapped)
600599

601600
def isNull(self) -> bool:
602601
"""

cadquery/vis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from . import Shape, Workplane, Assembly, Sketch, Compound, Color, Vector, Location
22
from .occ_impl.assembly import _loc2vtk, toVTK
33

4-
from typing import Union, Any, List, Tuple
4+
from typing import Union, Any, List, Tuple, Iterable, cast
55

66
from typish import instance_of
77

@@ -121,7 +121,7 @@ def _to_vtk_pts(
121121
return rv
122122

123123

124-
def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkActor:
124+
def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkAssembly:
125125
"""
126126
Convert Locations to vtkActor.
127127
"""
@@ -175,7 +175,7 @@ def show(
175175
win.AddRenderer(renderer)
176176

177177
# get renderer and actor
178-
for act in renderer.GetActors():
178+
for act in cast(Iterable[vtkActor], renderer.GetActors()):
179179

180180
propt = act.GetProperty()
181181

@@ -241,7 +241,7 @@ def show(
241241
inter.Initialize()
242242

243243
w, h = win.GetScreenSize()
244-
win.SetSize((w // 2, h // 2))
244+
win.SetSize(w // 2, h // 2)
245245
win.SetPosition(-10, 0)
246246

247247
# show and return

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requirements:
1616
- setuptools
1717
run:
1818
- python >=3.9
19-
- ocp 7.7.2
19+
- cadquery/label/dev::ocp=7.8.1
2020
- vtk=*=qt*
2121
- pyparsing >=2.1.9
2222
- ezdxf>=1.3.0

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python>=3.9,<=3.12
66
- ipython
7-
- ocp=7.7.2
7+
- ocp=7.8.1
88
- vtk=*=qt*
99
- pyparsing>=2.1.9
1010
- sphinx=8.1.3

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Only include the installation dependencies if we are not running on RTD or AppVeyor or in a conda env
2727
if not is_rtd and not is_appveyor and not is_azure and not is_conda:
2828
reqs = [
29-
"cadquery-ocp>=7.7.0,<7.8",
29+
"cadquery-ocp>=7.8.1,<7.9",
3030
"ezdxf>=1.3.0",
3131
"multimethod>=1.11,<2.0",
3232
"nlopt>=2.9.0,<3.0",

0 commit comments

Comments
 (0)