From 2b6c252a3e5efb1e3fc97c3c8a5facf6be68c5ab Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Fri, 17 Jun 2022 15:09:52 +0100
Subject: [PATCH] Further fixes

---
 bilby/core/utils/log.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/bilby/core/utils/log.py b/bilby/core/utils/log.py
index d9db7581c..5b4dfd750 100644
--- a/bilby/core/utils/log.py
+++ b/bilby/core/utils/log.py
@@ -1,5 +1,4 @@
 import logging
-import os
 from pathlib import Path
 import sys
 
@@ -60,13 +59,8 @@ def setup_logger(outdir='.', label=None, log_level='INFO', print_version=False):
 
 
 def get_version_information():
-    version_file = os.path.join(
-        os.path.dirname(os.path.dirname(os.path.dirname(__file__))), '.version')
-    try:
-        with open(version_file, 'r') as f:
-            return f.readline().rstrip()
-    except EnvironmentError:
-        print("No version information file '.version' found")
+    from bilby_pipe import _version
+    return _version.get_versions()["version"]
 
 
 def loaded_modules_dict():
-- 
GitLab