Skip to content
Snippets Groups Projects

fix default determination to handle symlinked casa installs

Merged Charlotte Hausman requested to merge fix-matrix-default-symlinks into 2.8.4-DEVELOPMENT
All threads resolved!
1 file
+ 3
12
Compare changes
  • Side-by-side
  • Inline
@@ -58,25 +58,16 @@ def casa_version_from_path(path: str) -> str:
# Defaults
casa_version, pipeline_version = "unknown", "default"
def check_regex(regex: str, path_str: str) -> re.Match[str] | None:
"""
check casa paths against version and pipeline regexes
:param regex:
:param path_str:
:return:
"""
return re.search(regex, path_str)
cv_search = check_regex(CASA_VERSION_REGEX, path)
cv_search = re.search(CASA_VERSION_REGEX, path)
if cv_search is None:
# this is probably a default link, make sure we use the actual version path
path2 = pathlib.Path(path)
if path2.is_symlink():
path = str(path2.readlink())
cv_search = check_regex(CASA_VERSION_REGEX, path)
cv_search = re.search(CASA_VERSION_REGEX, path)
pv_search = check_regex(PIPELINE_VERSION_REGEX, path)
pv_search = re.search(PIPELINE_VERSION_REGEX, path)
if cv_search:
# Replace last '-' in the directory name with '.' to match versions stored in the database
Loading