diff --git a/src/mod_info.cpp b/src/mod_info.cpp index 77ed769..471f528 100644 --- a/src/mod_info.cpp +++ b/src/mod_info.cpp @@ -4,9 +4,11 @@ PYBIND11_PLUGIN(info) { py::module m("info", "Storm information"); py::class_(m, "Version", "Version information for Storm") - .def_property_readonly("short", &storm::utility::StormVersion::shortVersionString, "Storm version in short representation") - .def_property_readonly("long", &storm::utility::StormVersion::longVersionString, "Storm version in long representation") - .def_property_readonly("build_info", &storm::utility::StormVersion::buildInfo, "Build info for Storm") + // static properties are still called with self as argument (which we ignore), see + // https://pybind11.readthedocs.io/en/master/advanced/classes.html#static-properties + .def_property_readonly_static("short", [](py::object /* self */){ return storm::utility::StormVersion::shortVersionString(); }, "Storm version in short representation") + .def_property_readonly_static("long", [](py::object /* self */){ return storm::utility::StormVersion::longVersionString(); }, "Storm version in long representation") + .def_property_readonly_static("build_info", [](py::object /* self */){ return storm::utility::StormVersion::buildInfo(); }, "Build info for Storm") ; return m.ptr(); } diff --git a/tests/info/test_info.py b/tests/info/test_info.py index 176e4fd..1545fb0 100644 --- a/tests/info/test_info.py +++ b/tests/info/test_info.py @@ -4,6 +4,6 @@ from stormpy.info import info class TestInfo: def test_version(self): - s = info.Version.short - s = info.Version.long - s = info.Version.build_info + assert isinstance(info.Version.short, str) and "." in info.Version.short + assert isinstance(info.Version.long, str) and "Version" in info.Version.long + assert isinstance(info.Version.build_info, str) and "Compiled" in info.Version.build_info