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
This commit is contained in:
AU
2025-01-18 21:04:05 +01:00
committed by GitHub
parent b8370dd17c
commit d1e4cb660d
5 changed files with 8 additions and 9 deletions

View File

@ -300,7 +300,6 @@ from ..utils import deprecate
Real = Union[float, int]
TOLERANCE = 1e-6
HASH_CODE_MAX = 2147483647 # max 32bit signed int, required by OCC.Core.HashCode
shape_LUT = {
ta.TopAbs_VERTEX: "Vertex",
@ -596,7 +595,7 @@ class Shape(object):
Returns a hashed value denoting this shape. It is computed from the
TShape and the Location. The Orientation is not used.
"""
return self.wrapped.HashCode(HASH_CODE_MAX)
return hash(self.wrapped)
def isNull(self) -> bool:
"""

View File

@ -1,7 +1,7 @@
from . import Shape, Workplane, Assembly, Sketch, Compound, Color, Vector, Location
from .occ_impl.assembly import _loc2vtk, toVTK
from typing import Union, Any, List, Tuple
from typing import Union, Any, List, Tuple, Iterable, cast
from typish import instance_of
@ -121,7 +121,7 @@ def _to_vtk_pts(
return rv
def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkActor:
def _to_vtk_axs(locs: List[Location], scale: float = 0.1) -> vtkAssembly:
"""
Convert Locations to vtkActor.
"""
@ -175,7 +175,7 @@ def show(
win.AddRenderer(renderer)
# get renderer and actor
for act in renderer.GetActors():
for act in cast(Iterable[vtkActor], renderer.GetActors()):
propt = act.GetProperty()
@ -241,7 +241,7 @@ def show(
inter.Initialize()
w, h = win.GetScreenSize()
win.SetSize((w // 2, h // 2))
win.SetSize(w // 2, h // 2)
win.SetPosition(-10, 0)
# show and return

View File

@ -16,7 +16,7 @@ requirements:
- setuptools
run:
- python >=3.9
- ocp 7.7.2
- cadquery/label/dev::ocp=7.8.1
- vtk=*=qt*
- pyparsing >=2.1.9
- ezdxf>=1.3.0

View File

@ -4,7 +4,7 @@ channels:
dependencies:
- python>=3.9,<=3.12
- ipython
- ocp=7.7.2
- ocp=7.8.1
- vtk=*=qt*
- pyparsing>=2.1.9
- sphinx=8.1.3

View File

@ -26,7 +26,7 @@ is_conda = "CONDA_PREFIX" in os.environ
# Only include the installation dependencies if we are not running on RTD or AppVeyor or in a conda env
if not is_rtd and not is_appveyor and not is_azure and not is_conda:
reqs = [
"cadquery-ocp>=7.7.0,<7.8",
"cadquery-ocp>=7.8.1,<7.9",
"ezdxf>=1.3.0",
"multimethod>=1.11,<2.0",
"nlopt>=2.9.0,<3.0",