Skip to content

Commit

Permalink
Dbbact version (#252)
Browse files Browse the repository at this point in the history
* add semantic version support to database version check

* update minimal dbbact version in config file to semantic version
  • Loading branch information
amnona committed Apr 9, 2021
1 parent 881e136 commit 19aa22b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion calour/calour.config
Expand Up @@ -4,7 +4,7 @@ class_name = DBBact
website = www.dbbact.org
installation = pip install git+git://github.com/amnona/dbbact-calour
description = manual annotations about bacterial amplicon sequences
min_version = 1.1.0
min_version = 1.4

[sponge]
module_name = spongeworld_calour
Expand Down
3 changes: 2 additions & 1 deletion calour/database.py
Expand Up @@ -28,6 +28,7 @@

from .util import get_config_value, get_config_file, get_config_sections
from .experiment import Experiment
from packaging import version

logger = getLogger(__name__)

Expand Down Expand Up @@ -57,7 +58,7 @@ def _get_database_class(dbname, exp=None, config_file_name=None):
'''
class_name = get_config_value('class_name', section=dbname, config_file_name=config_file_name)
module_name = get_config_value('module_name', section=dbname, config_file_name=config_file_name)
min_version = get_config_value('min_version', section=dbname, config_file_name=config_file_name, fallback='0.0')
min_version = version.parse(get_config_value('min_version', section=dbname, config_file_name=config_file_name, fallback='0.0'))
module_website = get_config_value('website', section=dbname, config_file_name=config_file_name, fallback='NA')

if class_name is not None and module_name is not None:
Expand Down

0 comments on commit 19aa22b

Please sign in to comment.