diff --git a/src/geant4_python_application/__init__.py b/src/geant4_python_application/__init__.py index 48ecde2..10d288c 100644 --- a/src/geant4_python_application/__init__.py +++ b/src/geant4_python_application/__init__.py @@ -73,8 +73,10 @@ def install_datasets(always: bool = False) -> None: Application, PrimaryGeneratorAction, StackingAction, + __awkward_version__, __doc__, __geant4_version__, + __pybind11_version__, __version__, ) from geant4_python_application.gdml import basic_gdml @@ -88,6 +90,8 @@ def install_datasets(always: bool = False) -> None: "__doc__", "__version__", "__geant4_version__", + "__awkward_version__", + "__pybind11_version__", "Application", "PrimaryGeneratorAction", "StackingAction", diff --git a/src/python/module.cpp b/src/python/module.cpp index 3f00df9..ab1cdc7 100644 --- a/src/python/module.cpp +++ b/src/python/module.cpp @@ -62,4 +62,6 @@ PYBIND11_MODULE(_core, m) { m.attr("__version__") = "dev"; #endif m.attr("__geant4_version__") = MACRO_STRINGIFY(GEANT4_VERSION); + m.attr("__awkward_version__") = MACRO_STRINGIFY(AWKWARD_VERSION); + m.attr("__pybind11_version__") = MACRO_STRINGIFY(PYBIND11_VERSION); } diff --git a/tests/test_module.py b/tests/test_module.py new file mode 100644 index 0000000..e95eca0 --- /dev/null +++ b/tests/test_module.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +import pathlib + +import geant4_python_application + + +def test_versions(): + awkward_version = geant4_python_application.__awkward_version__ + assert awkward_version + pybind11_version = geant4_python_application.__pybind11_version__ + assert pybind11_version + geant4_version = geant4_python_application.__geant4_version__ + assert geant4_version + + +def test_geant4_config(): + geant4_config = pathlib.Path(geant4_python_application.geant4_config) + assert geant4_config.exists() + assert geant4_config.is_file() + + geant4_python_application.check_datasets() + geant4_python_application.install_datasets()