From 1caedde35eefea530dc9542030ee8a3b2864e286 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Thu, 10 Oct 2024 08:39:27 +0800 Subject: [PATCH] Fix broken tests - remove assimp from tests - create pdm 'test' group for packages used by tests - fix "coverage run" tests failing because Python env missing --- .gitignore | 1 + pdm.lock | 183 +++++++++++++++++++++++++++++++++---- pyproject.toml | 8 ++ scripts/webapi/webapi.py | 14 ++- test/regression/reg_run.sh | 20 ++-- test/run_test.sh | 27 ++---- 6 files changed, 203 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index e42292f..2f6eddc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .tox/ .pdm-python +test/badge/ diff --git a/pdm.lock b/pdm.lock index 4831991..99dc10f 100644 --- a/pdm.lock +++ b/pdm.lock @@ -2,10 +2,10 @@ # It is not intended for manual editing. [metadata] -groups = ["default"] +groups = ["default", "test"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:8a44114a4d2b955bc59e31701d43cb291942e0e8d09eab74493667fc4fad19bb" +content_hash = "sha256:27a4efee379c00c25750a5a1e1d93d80bd6b6111ff7cf0820cd4a5b52fc7c1ee" [[metadata.targets]] requires_python = ">=3.9" @@ -40,7 +40,7 @@ name = "anyio" version = "4.4.0" requires_python = ">=3.8" summary = "High level compatibility layer for multiple asynchronous event loop implementations" -groups = ["default"] +groups = ["default", "test"] dependencies = [ "exceptiongroup>=1.0.2; python_version < \"3.11\"", "idna>=2.8", @@ -57,7 +57,7 @@ name = "certifi" version = "2024.8.30" requires_python = ">=3.6" summary = "Python package for providing Mozilla's CA Bundle." -groups = ["default"] +groups = ["default", "test"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -68,7 +68,7 @@ name = "charset-normalizer" version = "3.3.2" requires_python = ">=3.7.0" summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -groups = ["default"] +groups = ["default", "test"] files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -139,7 +139,7 @@ name = "click" version = "8.1.7" requires_python = ">=3.7" summary = "Composable command line interface toolkit" -groups = ["default"] +groups = ["default", "test"] dependencies = [ "colorama; platform_system == \"Windows\"", "importlib-metadata; python_version < \"3.8\"", @@ -154,13 +154,84 @@ name = "colorama" version = "0.4.6" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" summary = "Cross-platform colored terminal text." -groups = ["default"] +groups = ["default", "test"] marker = "sys_platform == \"win32\" or platform_system == \"Windows\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "coverage" +version = "7.6.2" +requires_python = ">=3.9" +summary = "Code coverage measurement for Python" +groups = ["test"] +files = [ + {file = "coverage-7.6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c9df1950fb92d49970cce38100d7e7293c84ed3606eaa16ea0b6bc27175bb667"}, + {file = "coverage-7.6.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:24500f4b0e03aab60ce575c85365beab64b44d4db837021e08339f61d1fbfe52"}, + {file = "coverage-7.6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a663b180b6669c400b4630a24cc776f23a992d38ce7ae72ede2a397ce6b0f170"}, + {file = "coverage-7.6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfde025e2793a22efe8c21f807d276bd1d6a4bcc5ba6f19dbdfc4e7a12160909"}, + {file = "coverage-7.6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:087932079c065d7b8ebadd3a0160656c55954144af6439886c8bcf78bbbcde7f"}, + {file = "coverage-7.6.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9c6b0c1cafd96213a0327cf680acb39f70e452caf8e9a25aeb05316db9c07f89"}, + {file = "coverage-7.6.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6e85830eed5b5263ffa0c62428e43cb844296f3b4461f09e4bdb0d44ec190bc2"}, + {file = "coverage-7.6.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:62ab4231c01e156ece1b3a187c87173f31cbeee83a5e1f6dff17f288dca93345"}, + {file = "coverage-7.6.2-cp310-cp310-win32.whl", hash = "sha256:7b80fbb0da3aebde102a37ef0138aeedff45997e22f8962e5f16ae1742852676"}, + {file = "coverage-7.6.2-cp310-cp310-win_amd64.whl", hash = "sha256:d20c3d1f31f14d6962a4e2f549c21d31e670b90f777ef4171be540fb7fb70f02"}, + {file = "coverage-7.6.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bb21bac7783c1bf6f4bbe68b1e0ff0d20e7e7732cfb7995bc8d96e23aa90fc7b"}, + {file = "coverage-7.6.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a7b2e437fbd8fae5bc7716b9c7ff97aecc95f0b4d56e4ca08b3c8d8adcaadb84"}, + {file = "coverage-7.6.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:536f77f2bf5797983652d1d55f1a7272a29afcc89e3ae51caa99b2db4e89d658"}, + {file = "coverage-7.6.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f361296ca7054f0936b02525646b2731b32c8074ba6defab524b79b2b7eeac72"}, + {file = "coverage-7.6.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7926d8d034e06b479797c199747dd774d5e86179f2ce44294423327a88d66ca7"}, + {file = "coverage-7.6.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0bbae11c138585c89fb4e991faefb174a80112e1a7557d507aaa07675c62e66b"}, + {file = "coverage-7.6.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:fcad7d5d2bbfeae1026b395036a8aa5abf67e8038ae7e6a25c7d0f88b10a8e6a"}, + {file = "coverage-7.6.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f01e53575f27097d75d42de33b1b289c74b16891ce576d767ad8c48d17aeb5e0"}, + {file = "coverage-7.6.2-cp311-cp311-win32.whl", hash = "sha256:7781f4f70c9b0b39e1b129b10c7d43a4e0c91f90c60435e6da8288efc2b73438"}, + {file = "coverage-7.6.2-cp311-cp311-win_amd64.whl", hash = "sha256:9bcd51eeca35a80e76dc5794a9dd7cb04b97f0e8af620d54711793bfc1fbba4b"}, + {file = "coverage-7.6.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ebc94fadbd4a3f4215993326a6a00e47d79889391f5659bf310f55fe5d9f581c"}, + {file = "coverage-7.6.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9681516288e3dcf0aa7c26231178cc0be6cac9705cac06709f2353c5b406cfea"}, + {file = "coverage-7.6.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d9c5d13927d77af4fbe453953810db766f75401e764727e73a6ee4f82527b3e"}, + {file = "coverage-7.6.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b92f9ca04b3e719d69b02dc4a69debb795af84cb7afd09c5eb5d54b4a1ae2191"}, + {file = "coverage-7.6.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ff2ef83d6d0b527b5c9dad73819b24a2f76fdddcfd6c4e7a4d7e73ecb0656b4"}, + {file = "coverage-7.6.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:47ccb6e99a3031ffbbd6e7cc041e70770b4fe405370c66a54dbf26a500ded80b"}, + {file = "coverage-7.6.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a867d26f06bcd047ef716175b2696b315cb7571ccb951006d61ca80bbc356e9e"}, + {file = "coverage-7.6.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:cdfcf2e914e2ba653101157458afd0ad92a16731eeba9a611b5cbb3e7124e74b"}, + {file = "coverage-7.6.2-cp312-cp312-win32.whl", hash = "sha256:f9035695dadfb397bee9eeaf1dc7fbeda483bf7664a7397a629846800ce6e276"}, + {file = "coverage-7.6.2-cp312-cp312-win_amd64.whl", hash = "sha256:5ed69befa9a9fc796fe015a7040c9398722d6b97df73a6b608e9e275fa0932b0"}, + {file = "coverage-7.6.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4eea60c79d36a8f39475b1af887663bc3ae4f31289cd216f514ce18d5938df40"}, + {file = "coverage-7.6.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:aa68a6cdbe1bc6793a9dbfc38302c11599bbe1837392ae9b1d238b9ef3dafcf1"}, + {file = "coverage-7.6.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ec528ae69f0a139690fad6deac8a7d33629fa61ccce693fdd07ddf7e9931fba"}, + {file = "coverage-7.6.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed5ac02126f74d190fa2cc14a9eb2a5d9837d5863920fa472b02eb1595cdc925"}, + {file = "coverage-7.6.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21c0ea0d4db8a36b275cb6fb2437a3715697a4ba3cb7b918d3525cc75f726304"}, + {file = "coverage-7.6.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:35a51598f29b2a19e26d0908bd196f771a9b1c5d9a07bf20be0adf28f1ad4f77"}, + {file = "coverage-7.6.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:c9192925acc33e146864b8cf037e2ed32a91fdf7644ae875f5d46cd2ef086a5f"}, + {file = "coverage-7.6.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bf4eeecc9e10f5403ec06138978235af79c9a79af494eb6b1d60a50b49ed2869"}, + {file = "coverage-7.6.2-cp313-cp313-win32.whl", hash = "sha256:e4ee15b267d2dad3e8759ca441ad450c334f3733304c55210c2a44516e8d5530"}, + {file = "coverage-7.6.2-cp313-cp313-win_amd64.whl", hash = "sha256:c71965d1ced48bf97aab79fad56df82c566b4c498ffc09c2094605727c4b7e36"}, + {file = "coverage-7.6.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:7571e8bbecc6ac066256f9de40365ff833553e2e0c0c004f4482facb131820ef"}, + {file = "coverage-7.6.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:078a87519057dacb5d77e333f740708ec2a8f768655f1db07f8dfd28d7a005f0"}, + {file = "coverage-7.6.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e5e92e3e84a8718d2de36cd8387459cba9a4508337b8c5f450ce42b87a9e760"}, + {file = "coverage-7.6.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ebabdf1c76593a09ee18c1a06cd3022919861365219ea3aca0247ededf6facd6"}, + {file = "coverage-7.6.2-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12179eb0575b8900912711688e45474f04ab3934aaa7b624dea7b3c511ecc90f"}, + {file = "coverage-7.6.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:39d3b964abfe1519b9d313ab28abf1d02faea26cd14b27f5283849bf59479ff5"}, + {file = "coverage-7.6.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:84c4315577f7cd511d6250ffd0f695c825efe729f4205c0340f7004eda51191f"}, + {file = "coverage-7.6.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ff797320dcbff57caa6b2301c3913784a010e13b1f6cf4ab3f563f3c5e7919db"}, + {file = "coverage-7.6.2-cp313-cp313t-win32.whl", hash = "sha256:2b636a301e53964550e2f3094484fa5a96e699db318d65398cfba438c5c92171"}, + {file = "coverage-7.6.2-cp313-cp313t-win_amd64.whl", hash = "sha256:d03a060ac1a08e10589c27d509bbdb35b65f2d7f3f8d81cf2fa199877c7bc58a"}, + {file = "coverage-7.6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c37faddc8acd826cfc5e2392531aba734b229741d3daec7f4c777a8f0d4993e5"}, + {file = "coverage-7.6.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab31fdd643f162c467cfe6a86e9cb5f1965b632e5e65c072d90854ff486d02cf"}, + {file = "coverage-7.6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97df87e1a20deb75ac7d920c812e9326096aa00a9a4b6d07679b4f1f14b06c90"}, + {file = "coverage-7.6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:343056c5e0737487a5291f5691f4dfeb25b3e3c8699b4d36b92bb0e586219d14"}, + {file = "coverage-7.6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4ef1c56b47b6b9024b939d503ab487231df1f722065a48f4fc61832130b90e"}, + {file = "coverage-7.6.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7fca4a92c8a7a73dee6946471bce6d1443d94155694b893b79e19ca2a540d86e"}, + {file = "coverage-7.6.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:69f251804e052fc46d29d0e7348cdc5fcbfc4861dc4a1ebedef7e78d241ad39e"}, + {file = "coverage-7.6.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e8ea055b3ea046c0f66217af65bc193bbbeca1c8661dc5fd42698db5795d2627"}, + {file = "coverage-7.6.2-cp39-cp39-win32.whl", hash = "sha256:6c2ba1e0c24d8fae8f2cf0aeb2fc0a2a7f69b6d20bd8d3749fd6b36ecef5edf0"}, + {file = "coverage-7.6.2-cp39-cp39-win_amd64.whl", hash = "sha256:2186369a654a15628e9c1c9921409a6b3eda833e4b91f3ca2a7d9f77abb4987c"}, + {file = "coverage-7.6.2-pp39.pp310-none-any.whl", hash = "sha256:667952739daafe9616db19fbedbdb87917eee253ac4f31d70c7587f7ab531b4e"}, + {file = "coverage-7.6.2.tar.gz", hash = "sha256:a5f81e68aa62bc0cfca04f7b19eaa8f9c826b53fc82ab9e2121976dc74f131f3"}, +] + [[package]] name = "dataclasses-json" version = "0.6.7" @@ -176,6 +247,17 @@ files = [ {file = "dataclasses_json-0.6.7.tar.gz", hash = "sha256:b6b3e528266ea45b9535223bc53ca645f5208833c29229e847b3f26a1cc55fc0"}, ] +[[package]] +name = "defusedxml" +version = "0.7.1" +requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +summary = "XML bomb protection for Python stdlib modules" +groups = ["test"] +files = [ + {file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"}, + {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, +] + [[package]] name = "deprecated" version = "1.2.14" @@ -206,7 +288,7 @@ name = "exceptiongroup" version = "1.2.2" requires_python = ">=3.7" summary = "Backport of PEP 654 (exception groups)" -groups = ["default"] +groups = ["default", "test"] marker = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, @@ -229,6 +311,23 @@ files = [ {file = "fastapi-0.114.2.tar.gz", hash = "sha256:0adb148b62edb09e8c6eeefa3ea934e8f276dabc038c5a82989ea6346050c3da"}, ] +[[package]] +name = "genbadge" +version = "1.1.1" +summary = "Generate badges for tools that do not provide one." +groups = ["test"] +dependencies = [ + "click>7.0", + "pathlib2; python_version < \"3.2\"", + "pillow", + "requests", + "setuptools", +] +files = [ + {file = "genbadge-1.1.1-py2.py3-none-any.whl", hash = "sha256:c8b67ccdad2867434cdc0be7c4bd3f6af6003c466d8ff5013b8b5842ca8730de"}, + {file = "genbadge-1.1.1.tar.gz", hash = "sha256:12cdaaacbc9e0ea3164bf580cfb87ec61ff17ae0728f09a7f0102f8ab3112f4c"}, +] + [[package]] name = "geojson" version = "3.1.0" @@ -302,7 +401,7 @@ name = "h11" version = "0.14.0" requires_python = ">=3.7" summary = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -groups = ["default"] +groups = ["default", "test"] dependencies = [ "typing-extensions; python_version < \"3.8\"", ] @@ -311,12 +410,45 @@ files = [ {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, ] +[[package]] +name = "httpcore" +version = "1.0.6" +requires_python = ">=3.8" +summary = "A minimal low-level HTTP client." +groups = ["test"] +dependencies = [ + "certifi", + "h11<0.15,>=0.13", +] +files = [ + {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, + {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, +] + +[[package]] +name = "httpx" +version = "0.27.2" +requires_python = ">=3.8" +summary = "The next generation HTTP client." +groups = ["test"] +dependencies = [ + "anyio", + "certifi", + "httpcore==1.*", + "idna", + "sniffio", +] +files = [ + {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, + {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, +] + [[package]] name = "idna" version = "3.10" requires_python = ">=3.6" summary = "Internationalized Domain Names in Applications (IDNA)" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -327,7 +459,7 @@ name = "iniconfig" version = "2.0.0" requires_python = ">=3.7" summary = "brain-dead simple config-ini parsing" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -561,7 +693,7 @@ name = "packaging" version = "24.1" requires_python = ">=3.8" summary = "Core utilities for Python packages" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, @@ -572,7 +704,7 @@ name = "pillow" version = "10.4.0" requires_python = ">=3.8" summary = "Python Imaging Library (Fork)" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "pillow-10.4.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:4d9667937cfa347525b319ae34375c37b9ee6b525440f3ef48542fcf66f2731e"}, {file = "pillow-10.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:543f3dc61c18dafb755773efc89aae60d06b6596a63914107f75459cf984164d"}, @@ -651,7 +783,7 @@ name = "pluggy" version = "1.5.0" requires_python = ">=3.8" summary = "plugin and hook calling mechanisms for python" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -835,7 +967,7 @@ name = "pytest" version = "8.3.3" requires_python = ">=3.8" summary = "pytest: simple powerful testing with Python" -groups = ["default"] +groups = ["default", "test"] dependencies = [ "colorama; sys_platform == \"win32\"", "exceptiongroup>=1.0.0rc8; python_version < \"3.11\"", @@ -933,7 +1065,7 @@ name = "requests" version = "2.32.3" requires_python = ">=3.8" summary = "Python HTTP for Humans." -groups = ["default"] +groups = ["default", "test"] dependencies = [ "certifi>=2017.4.17", "charset-normalizer<4,>=2", @@ -945,6 +1077,17 @@ files = [ {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] +[[package]] +name = "setuptools" +version = "75.1.0" +requires_python = ">=3.8" +summary = "Easily download, build, install, upgrade, and uninstall Python packages" +groups = ["test"] +files = [ + {file = "setuptools-75.1.0-py3-none-any.whl", hash = "sha256:35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"}, + {file = "setuptools-75.1.0.tar.gz", hash = "sha256:d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"}, +] + [[package]] name = "shapely" version = "2.0.6" @@ -1004,7 +1147,7 @@ name = "sniffio" version = "1.3.1" requires_python = ">=3.7" summary = "Sniff out which async library your code is running under" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -1078,7 +1221,7 @@ name = "tomli" version = "2.0.1" requires_python = ">=3.7" summary = "A lil' TOML parser" -groups = ["default"] +groups = ["default", "test"] marker = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, @@ -1090,7 +1233,7 @@ name = "typing-extensions" version = "4.12.2" requires_python = ">=3.8" summary = "Backported and Experimental Type Hints for Python 3.8+" -groups = ["default"] +groups = ["default", "test"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -1116,7 +1259,7 @@ name = "urllib3" version = "2.2.3" requires_python = ">=3.8" summary = "HTTP library with thread-safe connection pooling, file post, and more." -groups = ["default"] +groups = ["default", "test"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, diff --git a/pyproject.toml b/pyproject.toml index 9ee3da0..1b81c5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,14 @@ dependencies = [ ] requires-python = ">=3.9" +[project.optional-dependencies] +test = [ + "coverage>=7.6.2", + "defusedxml>=0.7.1", + "genbadge>=1.1.1", + "pytest>=8.3.3", + "httpx>=0.27.2", +] [build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" diff --git a/scripts/webapi/webapi.py b/scripts/webapi/webapi.py index c120498..9f9f836 100644 --- a/scripts/webapi/webapi.py +++ b/scripts/webapi/webapi.py @@ -25,7 +25,14 @@ from owslib.feature.wfs110 import WebFeatureService_1_1_0 from owslib.util import ServiceException from diskcache import Cache, Timeout -import pyassimp + +# If assimp (https://github.com/assimp/assimp) shared library is in the path, then multi format export will be supported +try: + import pyassimp + HAS_ASSIMP = True +except ImportError: + HAS_ASSIMP = False + from types import SimpleNamespace import copyreg from lxml import etree @@ -702,6 +709,11 @@ def convert_gltf2xxx(model, filename, fmt): :param fmt: string indicating what format to convert to, e.g. 'DXF' :returns: a file response ''' + # Exit if assimp library not available + if not HAS_ASSIMP: + LOGGER.warning(f"Assimp package not available or shared library not in LD_LIBRARY_PATH. Cannot convert {filename} to {fmt} and export") + return make_str_reponse("Multi-format export not supported. Please contact website administrator.") + # Use model name and file name to get full GLTF file path gltf_path = find_gltf(GEOMODELS_DIR, INPUT_DIR, model, filename) if not gltf_path: diff --git a/test/regression/reg_run.sh b/test/regression/reg_run.sh index 17c9ba2..73efbfb 100755 --- a/test/regression/reg_run.sh +++ b/test/regression/reg_run.sh @@ -65,7 +65,7 @@ for i in 'pl' 'ts' 'vs' 'gp' 'wl'; do echo -n "$i File test: " # Convert GOCAD to COLLADA -coverage run -a $CONV_SCRIPT -g -f $CWD/output "$CWD/input/${i}Test.$i" $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output "$CWD/input/${i}Test.$i" $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - conversion returned False" && exit 1 # Remove date stamps from file @@ -79,7 +79,7 @@ done # Test second type of well file echo -n "wl Type 2 File test: " -coverage run -a $CONV_SCRIPT -g -f $CWD/output "$CWD/input/wl2Test.wl" $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output "$CWD/input/wl2Test.wl" $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - conversion returned False" && exit 1 egrep -v '(|)' "$CWD/output/wl2Test.dae" > "$CWD/output/wl2Test2.dae" [ $? -ne 0 ] && echo "FAILED" && exit 1 @@ -93,7 +93,7 @@ compare_and_print "$CWD/output/wl2Test2.dae" "$CWD/golden/wl2Test.dae" ########################################################################################## echo -n "Convert objects nested within 2 levels of group files: " -coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/2layer.gp $MODEL_INDIR/TasConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/2layer.gp $MODEL_INDIR/TasConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - 2 layer gp conversion returned False" && exit 1 # Remove date stamps from file @@ -109,7 +109,7 @@ compare_and_print "$CWD/output/2layer2.dae" "$CWD/golden/2layer.dae" ########################################################################################## echo -n "Inherit colour from group file: " -coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/gpColour.gp $MODEL_INDIR/TasConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/gpColour.gp $MODEL_INDIR/TasConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - inherit colour from gp returned False" && exit 1 # Remove date stamps from file @@ -127,7 +127,7 @@ compare_and_print "$CWD/output/gpColour.dae" "$CWD/golden/gpColour.dae" echo -n "Convert single layer VOXET to PNG test, with colour table: " # Convert GOCAD to PNG with colour table -coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/PNGTest.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/PNGTest.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - ct conversion returned False" && exit 1 # Check that conversion was correct @@ -137,7 +137,7 @@ compare_and_print "$CWD/output/PNGTest@@.PNG" "$CWD/golden/PNGTest.PNG" echo -n "Convert single layer VOXET to PNG test, without colour table: " # Convert GOCAD to PNG without colour table -coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/PNGTestNoCT.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/PNGTestNoCT.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - ct conversion returned False" && exit 1 # Check that conversion was correct @@ -151,7 +151,7 @@ compare_and_print "$CWD/output/PNGTestNoCT@@.PNG" "$CWD/golden/PNGTestNoCT.PNG" echo -n "Convert single layer RGBA voxet to PNG test: " -coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/RGBA_voxet.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output $CWD/input/RGBA_voxet.vo $MODEL_INDIR/NorthGawlerConvParam.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - ct conversion returned False" && exit 1 # Check that conversion was correct @@ -164,7 +164,7 @@ compare_and_print "$CWD/output/RGBA_voxet@@.PNG" "$CWD/golden/RGBA_voxet.PNG" echo -n "Voxet with 3 binary files conversion & output config test: " -coverage run -a $CONV_SCRIPT -g -f $CWD/output -o smallConf.json $CWD/input/small_voxet/small.vo $CWD/input/small_voxet/small.json >/dev/null 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -f $CWD/output -o smallConf.json $CWD/input/small_voxet/small.vo $CWD/input/small_voxet/small.json >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - conversion returned False" && exit 1 # Check that conversion was correct @@ -189,7 +189,7 @@ compare_and_print "$CWD/output/smallConf.json" "$CWD/golden/smallConf.json" echo -n "Directory recursion test: " # Try converting all files at once -coverage run -a $CONV_SCRIPT -g -r -f $CWD/output $CWD/input $MODEL_INDIR/NorthGawlerConvParam.json +python3 -m coverage run -a $CONV_SCRIPT -g -r -f $CWD/output $CWD/input $MODEL_INDIR/NorthGawlerConvParam.json # >/dev/null 2>&1 [ $? -ne 0 ] && echo "FAILED - conversion returned False" && exit 1 @@ -211,7 +211,7 @@ echo -n "File output exception handling tests: " mkdir $CWD/output chmod a-w $CWD/output for f in tsTest.ts PNGTest.vo gpTest.gp vsTest.vs RGBA_voxet.vo wlTest.wl; do -coverage run -a $CONV_SCRIPT -g -r -f $CWD/output $CWD/input/$f $MODEL_INDIR/NorthGawlerConvParam.json > output.txt 2>&1 +python3 -m coverage run -a $CONV_SCRIPT -g -r -f $CWD/output $CWD/input/$f $MODEL_INDIR/NorthGawlerConvParam.json > output.txt 2>&1 [ $? -ne 0 ] && echo "FAILED - test returned False $f" && exit 1 grep 'ERROR - Cannot open file' output.txt >/dev/null 2>&1 && [ $? -ne 0 ] && echo "FAILED - $f" && exit 1 done diff --git a/test/run_test.sh b/test/run_test.sh index 43743f4..114ee06 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -5,19 +5,9 @@ # Remove old venv pdm venv remove -y for-test # Create new venv -pdm venv create --with-pip --name for-test 3.10 +pdm venv create --name for-test 3.10 eval $(pdm venv activate for-test) -pip install --upgrade pip -pdm install --venv for-test - -ASSIMP_VER=5.4.3 -REPO_DIR=`dirname $PWD` -# NB: assimp shared library is already built as part of 'pdm install' -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$REPO_DIR/assimp-$ASSIMP_VER/bin -echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - -# Install coverage -python3 -m pip install coverage defusedxml genbadge +pdm install -G test --venv for-test # Test GOCAD import & conversion pushd unit/gocad_import > /dev/null @@ -26,15 +16,14 @@ python3 -m coverage run gocad_importer_test.py [ $? -ne 0 ] && exit 1 popd > /dev/null -# Test assimp_kit -pushd unit/assimp_kit > /dev/null -coverage erase -coverage run test_assimp_kit.py -[ $? -ne 0 ] && exit 1 -popd > /dev/null +## Test assimp_kit +#pushd unit/assimp_kit > /dev/null +#coverage erase +#coverage run test_assimp_kit.py +#[ $? -ne 0 ] && exit 1 +#popd > /dev/null # Test webapi -python3 -m pip install pytest httpx pushd unit/webapi > /dev/null coverage erase coverage run --source webapi -m pytest