diff --git a/src/rosetta_finder/__init__.py b/src/rosetta_finder/__init__.py index dd7e97e..345d052 100644 --- a/src/rosetta_finder/__init__.py +++ b/src/rosetta_finder/__init__.py @@ -8,4 +8,4 @@ __all__ = ["RosettaFinder", "RosettaBinary", "main"] -__version__ = "0.0.3" +__version__ = "0.0.4" diff --git a/src/rosetta_finder/rosetta_finder.py b/src/rosetta_finder/rosetta_finder.py index b0d7db3..b3507e4 100644 --- a/src/rosetta_finder/rosetta_finder.py +++ b/src/rosetta_finder/rosetta_finder.py @@ -30,7 +30,7 @@ class RosettaBinary: dirname: str binary_name: str - mode: Optional[Literal["static", "mpi", "default"]] + mode: Optional[Literal["static", "mpi", "default", "cxx11threadserialization"]] os: Literal["linux", "macos"] compiler: Literal["gcc", "clang"] release: Literal["release", "debug"] @@ -78,7 +78,7 @@ def from_filename(cls, dirname: str, filename: str): # Regular expression to parse the filename regex = r""" ^(?P.+?)\. - ((?Pdefault|mpi|static)\.)? + ((?Pdefault|mpi|static|cxx11threadserialization)\.)? (?Plinux|macos) (?Pgcc|clang) (?Prelease|debug)$ @@ -132,7 +132,7 @@ def build_regex_pattern(self, binary_name): Returns: re.Pattern: Compiled regular expression pattern. """ - regex_string = rf"{binary_name}\.((default|mpi|static)\.){{0,1}}(linux|macos)(gcc|clang)(release|debug)$" + regex_string = rf"{binary_name}\.((default|mpi|static|cxx11threadserialization)\.){{0,1}}(linux|macos)(gcc|clang)(release|debug)$" return re.compile(regex_string) def get_search_paths(self): diff --git a/tests/test_rosetta_finder.py b/tests/test_rosetta_finder.py index 0ba6bf8..5955c31 100644 --- a/tests/test_rosetta_finder.py +++ b/tests/test_rosetta_finder.py @@ -24,6 +24,8 @@ def test_from_filename_valid(self): "rosetta_scripts.mpi.macosclangdebug", "rosetta_scripts.static.linuxgccrelease", "rosetta_scripts.default.macosclangdebug", + "rosetta_scripts.cxx11threadserialization.linuxgccrelease", # Docker serial + # "rosetta_scripts", # Docker serial ] for filename in valid_filenames: @@ -31,7 +33,7 @@ def test_from_filename_valid(self): rosetta_binary = RosettaBinary.from_filename(dirname, filename) self.assertEqual(rosetta_binary.dirname, dirname) self.assertEqual(rosetta_binary.binary_name, "rosetta_scripts") - self.assertIn(rosetta_binary.mode, [None, "mpi", "static", "default"]) + self.assertIn(rosetta_binary.mode, [None, "mpi", "static", "default", "cxx11threadserialization"]) self.assertIn(rosetta_binary.os, ["linux", "macos"]) self.assertIn(rosetta_binary.compiler, ["gcc", "clang"]) self.assertIn(rosetta_binary.release, ["release", "debug"])