diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5bd4419..36af5d52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,7 @@ poetry install Install with the `rhino` and `cad` extras: ```shell -poetry install --all-extras +poetry install --extras "dxf rhino" ``` You can now run an interactive Python session, or the command-line interface: diff --git a/docs/contributing.rst b/docs/contributing.rst index 715e36c5..107b6e1f 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -95,7 +95,7 @@ Install with the ``rhino`` and ``cad`` extras: .. code:: shell - poetry install --all-extras + poetry install --extras "dxf rhino" You can now run an interactive Python session, or the command-line interface: diff --git a/docs/installation.rst b/docs/installation.rst index 055ac095..8898cd7b 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -43,6 +43,3 @@ To install ``sectionproperties`` with the above functionality, use the ``dxf`` a pip install sectionproperties[dxf] pip install sectionproperties[rhino] - -Note that the ``rhino`` option only supports python ``3.9`` due to incomplete wheel -coverage of ``rhino3dm``. diff --git a/docs/user_guide/geometry.rst b/docs/user_guide/geometry.rst index 72e64ef6..31d5b840 100644 --- a/docs/user_guide/geometry.rst +++ b/docs/user_guide/geometry.rst @@ -111,10 +111,10 @@ Various CAD files can be imported to creating ``sectionproperties`` geometries. installation. To install ``sectionproperties`` with CAD import functionality, use the ``dxf`` and/or ``rhino`` options: -.. code-block:: shell + .. code-block:: shell - pip install sectionproperties[dxf] - pip install sectionproperties[rhino] + pip install sectionproperties[dxf] + pip install sectionproperties[rhino] .. _label-geometry-dxf: diff --git a/noxfile.py b/noxfile.py index 14640a91..72fa3f52 100644 --- a/noxfile.py +++ b/noxfile.py @@ -144,11 +144,9 @@ def tests(session: Session) -> None: Args: session: Nox session """ - # provide only dxf dependencies if python version is 3.10 or 3.11 - if session.python == "3.9": - session.run_always("poetry", "install", "--all-extras", external=True) - else: - session.run_always("poetry", "install", "--extras", "dxf", 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") @@ -161,7 +159,7 @@ def tests(session: Session) -> None: "-m", "pytest", "-m", - "not benchmark", + "not benchmark_suite", *session.posargs, ) finally: @@ -197,7 +195,9 @@ def docs_build(session: Session) -> None: if not session.posargs and "FORCE_COLOR" in os.environ: args.insert(0, "--color") - session.run_always("poetry", "install", "--all-extras", external=True) + session.run_always( + "poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True + ) session.install( "furo", "ipykernel", @@ -226,7 +226,9 @@ def docs(session: Session) -> None: session: Nox session """ args = session.posargs or ["--open-browser", "docs", "docs/_build"] - session.run_always("poetry", "install", "--all-extras", external=True) + session.run_always( + "poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True + ) session.install( "furo", "ipykernel", diff --git a/poetry.lock b/poetry.lock index bd0ddd53..e943b1bc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2964,24 +2964,26 @@ dev = ["Shapely (==1.8.0)", "black", "flake8", "isort", "matplotlib", "numpy (== [[package]] name = "rhino3dm" -version = "8.0.0b2" +version = "8.0.0b3" description = "Python library based on OpenNURBS with a RhinoCommon style" optional = true python-versions = "*" files = [ - {file = "rhino3dm-8.0.0b2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:a6c489e437f3f0b01b9e8e65279b1b5034ee2fba9eebd66fb768f1ed7ecd3a20"}, - {file = "rhino3dm-8.0.0b2-cp310-cp310-win_amd64.whl", hash = "sha256:d38cba0936d11daa29971a8673d3a73943baaf68ff6dada677dcead776143a40"}, - {file = "rhino3dm-8.0.0b2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:3acbad0f786dce24aed81cc32260aca476a87687fafc8bb19aaa60b89de8fe96"}, - {file = "rhino3dm-8.0.0b2-cp311-cp311-win_amd64.whl", hash = "sha256:373cc750cb2da540eaab10da186e23bddfc9c36e1e66804eb78fbc84478d14db"}, - {file = "rhino3dm-8.0.0b2-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:d9739559084afc489f38c5577871315d46db0b910ac9032373433975a3d0a062"}, - {file = "rhino3dm-8.0.0b2-cp37-cp37m-win_amd64.whl", hash = "sha256:0fc38de1771ee5cd066b93c89d09dc0bed1f2a0685a1b34bc02bccbe741aa6c0"}, - {file = "rhino3dm-8.0.0b2-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:9e69b21527294551418683b7bf1836d4432f70a3ada9211df861ac249b1cb78d"}, - {file = "rhino3dm-8.0.0b2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90b8711ff0aaf462aec4e4bddec892dc64390f3af213d5a0c292d38adf527dcd"}, - {file = "rhino3dm-8.0.0b2-cp38-cp38-win_amd64.whl", hash = "sha256:56280cfbf3bc2e2e70e92bda264f9553bb34037e6f48749d9c8466a5c76bf061"}, - {file = "rhino3dm-8.0.0b2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:ee636135ace4a3b6ffc36808fe4ccdebc8b6bc4894b52cca91c5a21779aacb6e"}, - {file = "rhino3dm-8.0.0b2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a741766ecc7f4d10e3001f8a2ab3d3d224503de0a130b9ea80fe0c437bb6a8ec"}, - {file = "rhino3dm-8.0.0b2-cp39-cp39-win_amd64.whl", hash = "sha256:b98c0935c4900c2c56ff2af03b7191ff36e464703622837ac719597201eb7d35"}, - {file = "rhino3dm-8.0.0b2.tar.gz", hash = "sha256:934dfa02c48f9c13951b2961bbda39dce099c88c62c93eaac98ac36f85f0a419"}, + {file = "rhino3dm-8.0.0b3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:8ce7eadf037909e1c42c36f64559bfca61a51a1d1bc5a06b6576446beb62d038"}, + {file = "rhino3dm-8.0.0b3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf8ea5e97cc8aa51cf54884c0efaa054348b6cfd97cf099fc228812e23ba089c"}, + {file = "rhino3dm-8.0.0b3-cp310-cp310-win_amd64.whl", hash = "sha256:eabdcc357cc5400a1bf4c7096980ee233291995256f1745eb7b046e3795abc0f"}, + {file = "rhino3dm-8.0.0b3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:8373a63ee4af8c4de6d2d6cc8e89d852623385d9989ba983d13626b9deeffe08"}, + {file = "rhino3dm-8.0.0b3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72b3a7a72a21b0cfa77386454a0a7bff56aafca57b926de6500e49e46dffde56"}, + {file = "rhino3dm-8.0.0b3-cp311-cp311-win_amd64.whl", hash = "sha256:9e8f8727ccd444e4e30161e2b5ac3472c1a0bf29ca779bf343a94ea36942e0c0"}, + {file = "rhino3dm-8.0.0b3-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:58ab7c87451880d047fdf55801e57b3888a506b03c59882cf583d60fc41d005d"}, + {file = "rhino3dm-8.0.0b3-cp37-cp37m-win_amd64.whl", hash = "sha256:62e3eb71742dac2b7786527cd38df39902bb7745d76b83782f984d05734e5685"}, + {file = "rhino3dm-8.0.0b3-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:abfb8350a5776d7dc74ca62b6b02095024966e0b34f849fe2d40e313ac07c777"}, + {file = "rhino3dm-8.0.0b3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a6dd819a8f16cda66089c73febd715643a8d796492732cbd7283865e5d323ce"}, + {file = "rhino3dm-8.0.0b3-cp38-cp38-win_amd64.whl", hash = "sha256:8c408d001fd77ffc40e71656db17eb1a32f4042950e9eabb5994ab636403fbea"}, + {file = "rhino3dm-8.0.0b3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:312f8bc96dc430bafd23fceb973a4698685cee3272ba866c005897b5e8b2a613"}, + {file = "rhino3dm-8.0.0b3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0f597ffa1997b3631842d7c1a9a46b345b30461908df45761bd5d29c0cdd9c5"}, + {file = "rhino3dm-8.0.0b3-cp39-cp39-win_amd64.whl", hash = "sha256:0c4b84354b0384b60b85da9b05f6ffbfe0816596601334a647f406aaaacc48e3"}, + {file = "rhino3dm-8.0.0b3.tar.gz", hash = "sha256:be3290e8198d2af25ad8807de99919a27674c0827adad3c36689810f9558c301"}, ] [[package]] @@ -3903,4 +3905,4 @@ rhino = ["rhino-shapley-interop", "rhino3dm"] [metadata] lock-version = "2.0" python-versions = ">=3.9.0,<3.12" -content-hash = "a46f7a7f515904dfc6333600e0b6a29204222b4ed409fe0dd7a42e6775e9dfbe" +content-hash = "52426e22d8d53cfb7d2f531b7c31874c9dc5b19ca297cd6f6b032addeb55941b" diff --git a/pyproject.toml b/pyproject.toml index 62a48206..2cf5cb60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,10 +57,10 @@ rich = "^13.6.0" click = "^8.1.7" more-itertools = "^10.1.0" cad-to-shapely = { version = "^0.3.1", optional = true } -rhino-shapley-interop = { version = "^0.0.4", python = ">=3.9.0,<3.10", optional = true } -rhino3dm = { version = "==8.0.0b2", python = ">=3.9.0,<3.10", optional = true } +rhino-shapley-interop = { version = "^0.0.4", optional = true } +rhino3dm = { version = "==8.0.0b3", optional = true } -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] black = "^23.9.1" coverage = { extras = ["toml"], version = "^7.3.2" } darglint = "^1.8.1" @@ -115,6 +115,7 @@ lines_after_imports = 2 [tool.pytest.ini_options] markers = [ + "benchmark_suite: entire benchmark test suite (select with '-m benchmark_suite')", "benchmark_geom: geometry benchmark tests (select with '-m benchmark_geom')", "benchmark_mesh: mesh benchmark tests (select with '-m benchmark_mesh')", "benchmark_analysis: analysis benchmark tests (select with '-m benchmark_analysis')", diff --git a/tests/benchmarks/test_benchmark_analysis.py b/tests/benchmarks/test_benchmark_analysis.py index bc2b1325..25b9a954 100644 --- a/tests/benchmarks/test_benchmark_analysis.py +++ b/tests/benchmarks/test_benchmark_analysis.py @@ -5,7 +5,7 @@ from sectionproperties.analysis import Section -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis @pytest.mark.parametrize("elements", [50, 500, 5000]) def test_create_section(benchmark, analysis_geometry, elements): @@ -18,7 +18,7 @@ def create_section(): benchmark(create_section) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis @pytest.mark.parametrize("elements", [50, 500, 5000]) def test_geometric_analysis(benchmark, analysis_geometry, elements): @@ -32,7 +32,7 @@ def geometric_analysis(): benchmark(geometric_analysis) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis def test_plastic_analysis(benchmark, analysis_geometry): """Benchmark test for conducting a plastic analysis. @@ -49,7 +49,7 @@ def plastic_analysis(): benchmark(plastic_analysis) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis @pytest.mark.parametrize("elements", [50, 500, 5000]) def test_warping_analysis(benchmark, analysis_geometry, elements): @@ -64,7 +64,7 @@ def warping_analysis(): benchmark(warping_analysis) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis @pytest.mark.parametrize("elements", [50, 500, 5000]) def test_frame_analysis(benchmark, analysis_geometry, elements): @@ -78,7 +78,7 @@ def frame_analysis(): benchmark(frame_analysis) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_analysis @pytest.mark.parametrize("elements", [50, 500, 5000]) def test_stress_analysis(benchmark, analysis_geometry, elements): diff --git a/tests/benchmarks/test_benchmark_geom.py b/tests/benchmarks/test_benchmark_geom.py index d7ab09e8..37573cb9 100644 --- a/tests/benchmarks/test_benchmark_geom.py +++ b/tests/benchmarks/test_benchmark_geom.py @@ -5,21 +5,21 @@ from sectionproperties.pre.library import circular_hollow_section, rectangular_section -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_geom def test_create_simple_geometry(benchmark): """Benchmark test for creating rectangular geometry.""" benchmark(rectangular_section, d=100, b=50) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_geom def test_create_intermediate_geometry(benchmark): """Benchmark test for creating CHS geometry.""" benchmark(circular_hollow_section, d=100, t=3, n=128) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_geom def test_create_complex_geometry(benchmark, concrete_column_with_hole): """Benchmark test for creating concrete geometry.""" diff --git a/tests/benchmarks/test_benchmark_mesh.py b/tests/benchmarks/test_benchmark_mesh.py index c0f019ff..804e77bb 100644 --- a/tests/benchmarks/test_benchmark_mesh.py +++ b/tests/benchmarks/test_benchmark_mesh.py @@ -3,7 +3,7 @@ import pytest -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_mesh @pytest.mark.parametrize("ms", [0.0, 50.0, 5.0]) def test_create_simple_mesh(benchmark, rect_geom, ms): @@ -12,7 +12,7 @@ def test_create_simple_mesh(benchmark, rect_geom, ms): benchmark(geom.create_mesh, ms) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_mesh @pytest.mark.parametrize("ms", [0.0, 1.0, 0.3]) def test_create_intermediate_mesh(benchmark, chs_geom, ms): @@ -21,7 +21,7 @@ def test_create_intermediate_mesh(benchmark, chs_geom, ms): benchmark(geom.create_mesh, ms) -@pytest.mark.benchmark +@pytest.mark.benchmark_suite @pytest.mark.benchmark_mesh @pytest.mark.parametrize("ms", [0.0, 100.0, 20.0]) def test_create_complex_mesh(benchmark, concrete_column_with_hole, ms): diff --git a/tests/geometry/test_geometry.py b/tests/geometry/test_geometry.py index b2c1f57c..ea38a87f 100644 --- a/tests/geometry/test_geometry.py +++ b/tests/geometry/test_geometry.py @@ -3,7 +3,6 @@ from __future__ import annotations import json -import sys from pathlib import Path import pytest @@ -480,7 +479,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, 10), reason="requires python 3.9") def test_geometry_from_3dm_file_simple(): """Tests loading geometry from a simple .3dm file.""" section = Path(__file__).parent.absolute() / "3in x 2in.3dm" @@ -489,7 +487,6 @@ def test_geometry_from_3dm_file_simple(): assert (test.geom - exp).is_empty -@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9") def test_geometry_from_3dm_file_complex(): """Tests loading geometry from a complex .3dm file.""" section_3dm = Path(__file__).parent.absolute() / "complex_shape.3dm" @@ -501,7 +498,6 @@ def test_geometry_from_3dm_file_complex(): assert (test.geom - exp).is_empty -@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9") def test_geometry_from_3dm_file_compound(): """Tests loading compound geometry from a .3dm file.""" section_3dm = Path(__file__).parent.absolute() / "compound_shape.3dm" @@ -513,7 +509,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, 10), reason="requires python 3.9") def test_geometry_from_3dm_encode(): """Tests loading compound geometry from a .json file.""" section_3dm = Path(__file__).parent.absolute() / "rhino_data.json"