@@ -50,7 +50,8 @@ from src.utils import (
50
50
pairs ,
51
51
permissions ,
52
52
check_cache ,
53
- require
53
+ require ,
54
+ tool_version
54
55
)
55
56
56
57
@@ -100,6 +101,27 @@ def run(sub_args):
100
101
# The pipelines has only two requirements:
101
102
# snakemake and singularity
102
103
require (['snakemake' , 'singularity' ], ['snakemake' , 'singularity' ])
104
+ # Check the version of snakemake in the
105
+ # user's $PATH, the pipeline supports
106
+ # snakemake versions < 8.0.0.
107
+ snakemake_version = tool_version ('snakemake' , ['snakemake' , '--version' ], strict = True )
108
+ parsed_version = re .search (
109
+ '^(?P<prefix>v)?(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)' ,
110
+ snakemake_version .split ()[- 1 ]
111
+ )
112
+ # Check the parsed major version of snakemake
113
+ if int (parsed_version .group ('major' )) >= 8 :
114
+ # Snakemake versions greater than or equal
115
+ # to 8.0.0 are not supported by genome-seek.
116
+ # This verison of snakemake introduced a set
117
+ # of breaking changes that are not compatible
118
+ # with the current pipeline. We will strictly
119
+ # enforce this until we move to profiles.
120
+ fatal (
121
+ 'Error: Snakemake version "{}" is not supported! Please use a version less than "8.0.0".' .format (
122
+ snakemake_version
123
+ )
124
+ )
103
125
104
126
if not sub_args .batch_id :
105
127
# Set value of batch identifer by
0 commit comments