diff --git a/CMakeLists.txt b/CMakeLists.txt index 14256666..97393d13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ nwx_cxx_api_docs("README.md" "${project_inc_dir}" "${project_src_dir}") ### Options ### cmaize_option_list( BUILD_TESTING OFF "Should we build unit tests?" - BUILD_PYBIND11_PYBINDINGS OFF "Build Pybind11 Python bindings?" + BUILD_PYBIND11_PYBINDINGS ON "Build Pybind11 Python bindings?" BUILD_ROCKSDB OFF "Enable RocksDB backend of the cache?" ) @@ -152,10 +152,6 @@ if("${BUILD_TESTING}") ### Python Tests ### set(python_test_dir "${CMAKE_CURRENT_LIST_DIR}/tests/python") - cmaize_find_or_build_dependency( - tox - PACKAGE_MANAGER pip - ) # In the python tests we will pass Python into PluginPlay, we will then # need to know that C++ can handle those Python types. To this end we @@ -166,11 +162,11 @@ if("${BUILD_TESTING}") INSTALL OFF SOURCE_DIR "${python_test_dir}/unit_tests" INCLUDE_DIRS "${project_inc_dir}" - DEPENDS ${PROJECT_NAME} tox + DEPENDS ${PROJECT_NAME} ) - nwx_tox_test( - py_pluginplay ${python_test_dir}/unit_tests + nwx_pybind11_tests( + py_pluginplay ${python_test_dir}/unit_tests/test_pluginplay.py SUBMODULES parallelzone ) diff --git a/src/python/module/export_module_base.cpp b/src/python/module/export_module_base.cpp index 1956f758..475e8a44 100644 --- a/src/python/module/export_module_base.cpp +++ b/src/python/module/export_module_base.cpp @@ -40,6 +40,7 @@ void export_module_base(py_module_reference m) { .def("property_types", &ModuleBase::property_types) .def("get_desc", &ModuleBase::get_desc) .def("citations", &ModuleBase::citations) + .def("get_runtime", &ModuleBase::get_runtime) // //.def("set_cache", &ModuleBase::set_cache) // .def("get_cache", &ModuleBase::get_cache) // .def("reset_internal_cache", &ModuleBase::reset_internal_cache) diff --git a/tests/python/unit_tests/module/test_module_base.py b/tests/python/unit_tests/module/test_module_base.py index 2fdc1f13..6a35fcbe 100644 --- a/tests/python/unit_tests/module/test_module_base.py +++ b/tests/python/unit_tests/module/test_module_base.py @@ -13,6 +13,7 @@ # limitations under the License. import pluginplay as pp +import parallelzone as pz import py_test_pluginplay as test_pp import unittest @@ -33,6 +34,7 @@ def run_(self, inputs, submods): i0, = pt.unwrap_inputs(inputs) i1 = inputs["An extra input"].value() + assert (self.get_runtime() == pz.runtime.RuntimeView()) r0 = submods["A submodule"].run_as(pt, i0 + i1) rv = self.results()