Skip to content

Commit

Permalink
Merge pull request #17 from Ensembl/bugfix/datacheck_app_version
Browse files Browse the repository at this point in the history
Bugfix/datacheck app version
  • Loading branch information
vinay-ebi authored Feb 1, 2022
2 parents 53d760f + f6c6cf6 commit 5d253fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ensembl/production/datacheck/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import pathlib
import pkg_resources
import requests.exceptions
from pathlib import Path

from ensembl.production.core.config import load_config_yaml

from ensembl.utils.rloader import RemoteFileLoader
Expand All @@ -28,6 +30,14 @@
logger.addHandler(default_handler)


def get_app_version():
try:
version = pkg_resources.require("datacheck")[0].version
except Exception as e:
with open(Path(__file__).parents[4] / 'VERSION') as f:
version = f.read()
return version

class DCConfigLoader:
base_uri = 'https://raw.githubusercontent.com/Ensembl/ensembl-datacheck/'
uri = base_uri + 'release/{}/lib/Bio/EnsEMBL/DataCheck/index.json'
Expand Down Expand Up @@ -91,4 +101,4 @@ class DatacheckConfig(EnsemblConfig):

DATACHECK_TYPE = os.environ.get('DATACHECK_TYPE', EnsemblConfig.file_config.get('datacheck_type', 'metazoa'))

APP_VERSION = version = pkg_resources.require("datacheck")[0].version
APP_VERSION = get_app_version()

0 comments on commit 5d253fc

Please sign in to comment.