Skip to content

Commit

Permalink
incl cal dist path in log message
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Sep 27, 2024
1 parent cb91e74 commit 0a24b8c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crds/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ def _get_file_info_map(observatory, files, fields):
return infos


def get_cal_dist_path(cal):
try:
return f' ({str(importlib.metadata.distribution(cal)._path)})'
except Exception:
return ''


def get_cal_version(observatory):
"""Return the version of observatory calibration software."""
cal_version = ''
Expand All @@ -248,7 +255,8 @@ def get_cal_version(observatory):
try:
cal_version = importlib.metadata.version(cal)
cal_version = config.simplify_version(cal_version)
log.info(f"Calibration SW Found: {cal} {cal_version}")
dist_path = get_cal_dist_path(cal)
log.info(f"Calibration SW Found: {cal} {cal_version}{dist_path}")
except importlib.metadata.PackageNotFoundError:
log.warning("Calibration SW not found, defaulting to latest.")
return cal_version
Expand Down

0 comments on commit 0a24b8c

Please sign in to comment.