Skip to content

Commit

Permalink
fix: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoYinYing committed Sep 24, 2024
1 parent ed6e3c9 commit 47f3e6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rosetta_finder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

__all__ = ["RosettaFinder", "RosettaBinary", "main"]

__version__ = "0.0.3"
__version__ = "0.0.4"
6 changes: 3 additions & 3 deletions src/rosetta_finder/rosetta_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -78,7 +78,7 @@ def from_filename(cls, dirname: str, filename: str):
# Regular expression to parse the filename
regex = r"""
^(?P<binary_name>.+?)\.
((?P<mode>default|mpi|static)\.)?
((?P<mode>default|mpi|static|cxx11threadserialization)\.)?
(?P<os>linux|macos)
(?P<compiler>gcc|clang)
(?P<release>release|debug)$
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion tests/test_rosetta_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ 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:
with self.subTest(filename=filename):
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"])
Expand Down

0 comments on commit 47f3e6f

Please sign in to comment.