From 87ec42a744e34462273919926fb7b108ad6764d4 Mon Sep 17 00:00:00 2001 From: yrasool <111371895+yrasool@users.noreply.github.com> Date: Tue, 23 Jun 2026 10:49:19 -0400 Subject: [PATCH] Add Python module version attributes --- python/mcnptools/__init__.py | 3 +++ python/mcnptools_tests/__init__.py | 1 + python/mcnptools_tests/versiontests.py | 9 +++++++++ 3 files changed, 13 insertions(+) create mode 100644 python/mcnptools_tests/versiontests.py diff --git a/python/mcnptools/__init__.py b/python/mcnptools/__init__.py index d91a084..81877d9 100644 --- a/python/mcnptools/__init__.py +++ b/python/mcnptools/__init__.py @@ -1,3 +1,6 @@ +__version_info__ = (5, 3, 1) +__version__ = ".".join(map(str, __version_info__)) + from .mcnptools_wrap import Mctal, MctalTally, MctalKcode, \ Meshtal, MeshtalTally, \ Ptrac, PtracHistory, PtracEvent, PtracNps, \ diff --git a/python/mcnptools_tests/__init__.py b/python/mcnptools_tests/__init__.py index a155baa..fd47e3a 100644 --- a/python/mcnptools_tests/__init__.py +++ b/python/mcnptools_tests/__init__.py @@ -2,3 +2,4 @@ from . import meshtaltests from . import bin_ptractests from . import asc_ptractests +from . import versiontests diff --git a/python/mcnptools_tests/versiontests.py b/python/mcnptools_tests/versiontests.py new file mode 100644 index 0000000..35cb0f5 --- /dev/null +++ b/python/mcnptools_tests/versiontests.py @@ -0,0 +1,9 @@ +import unittest +import mcnptools + + +class TestVersion(unittest.TestCase): + def testVersionInfo(self): + self.assertEqual(mcnptools.__version_info__, (5, 3, 1)) + self.assertEqual(mcnptools.__version__, "5.3.1") + self.assertEqual(mcnptools.__version__, ".".join(map(str, mcnptools.__version_info__)))