Skip to content

Commit

Permalink
Update rhino3dm, allow python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
robbievanleeuwen committed May 27, 2024
1 parent 76775cb commit 0aa0a51
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 63 deletions.
3 changes: 0 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,3 @@ To install ``sectionproperties`` with the above functionality, use the ``dxf`` a
pip install sectionproperties[dxf]
pip install sectionproperties[rhino]
.. warning:: The "rhino" extras do not currently support python 3.12, this may only be
installed for python 3.9, 3.10 and 3.11.
24 changes: 9 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,15 @@ def tests(session: Session) -> None:
Args:
session: Nox session
"""
# if python version is 3.12, don't install rhino extras
if session.python == "3.12":
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf", external=True
)
else:
session.run_always(
"poetry",
"install",
"--only",
"main",
"--extras",
"dxf rhino",
external=True,
)
session.run_always(
"poetry",
"install",
"--only",
"main",
"--extras",
"dxf rhino",
external=True,
)

# install relevant tooling
session.install("coverage[toml]", "pytest", "pygments", "pytest-check")
Expand Down
70 changes: 33 additions & 37 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ click = "^8.1.7"
more-itertools = "^10.2.0"
numba = { version = "^0.59.0", optional = true }
cad-to-shapely = { version = "^0.3.1", optional = true }
rhino-shapley-interop = { version = "^0.0.4", python = ">=3.9.0,<3.12", optional = true }
rhino3dm = { version = "^8.4.0", python = ">=3.9.0,<3.12", optional = true }
rhino-shapley-interop = { version = "^0.0.4", optional = true }
rhino3dm = { version = "==8.6.0", optional = true }
pypardiso = { version = "^0.4.5", optional = true }
intel-openmp = { version = "==2023.2.0", optional = true }
mkl = { version = "==2023.2.0", optional = true }
tbb = { version = "==2021.10.0", optional = true }

[tool.poetry.group.dev.dependencies]
black = "^24.2.0"
Expand Down Expand Up @@ -101,7 +102,7 @@ sphinxext-opengraph = "^0.9.1"
dxf = ["cad-to-shapely"]
rhino = ["rhino-shapley-interop", "rhino3dm"]
numba = ["numba"]
pardiso = ["pypardiso", "intel-openmp", "mkl"]
pardiso = ["pypardiso", "intel-openmp", "mkl", "tbb"]

[tool.poetry.scripts]
sectionproperties = "sectionproperties.__main__:main"
Expand Down
5 changes: 0 additions & 5 deletions tests/geometry/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import json
import platform
import sys
from pathlib import Path

import pytest
Expand Down Expand Up @@ -481,7 +480,6 @@ def test_geometry_from_dxf():
assert sp_geom.Geometry.from_dxf(section_holes_dxf).geom.wkt == poly


@pytest.mark.skipif(sys.version_info >= (3, 12), reason="requires python < 3.12")
def test_geometry_from_3dm_file_simple():
"""Tests loading geometry from a simple .3dm file."""
section = Path(__file__).parent.absolute() / "3in x 2in.3dm"
Expand All @@ -490,7 +488,6 @@ def test_geometry_from_3dm_file_simple():
assert (test.geom - exp).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 12), reason="requires python < 3.12")
def test_geometry_from_3dm_file_complex():
"""Tests loading geometry from a complex .3dm file."""
section_3dm = Path(__file__).parent.absolute() / "complex_shape.3dm"
Expand All @@ -502,7 +499,6 @@ def test_geometry_from_3dm_file_complex():
assert (test.geom - exp).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 12), reason="requires python < 3.12")
def test_geometry_from_3dm_file_compound():
"""Tests loading compound geometry from a .3dm file."""
section_3dm = Path(__file__).parent.absolute() / "compound_shape.3dm"
Expand All @@ -514,7 +510,6 @@ def test_geometry_from_3dm_file_compound():
assert (MultiPolygon([ii.geom for ii in test.geoms]) - MultiPolygon(exp)).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 12), reason="requires python < 3.12")
def test_geometry_from_3dm_encode():
"""Tests loading compound geometry from a .json file."""
section_3dm = Path(__file__).parent.absolute() / "rhino_data.json"
Expand Down

0 comments on commit 0aa0a51

Please sign in to comment.