Skip to content

Commit

Permalink
Merge pull request #133 from eWaterCycle/88-apptainer-invalid-version
Browse files Browse the repository at this point in the history
Support 1.1.5-2.el8 apptainer version
  • Loading branch information
sverhoeven authored Mar 21, 2023
2 parents 5a9fd3f + 44d55df commit 1327b07
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grpc4bmi/bmi_client_apptainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def check_apptainer_version_string(version_output: str) -> bool:
version = version_output.split(' ').pop()
local_version = Version(version)
local_version = Version(version.replace('.el', ''))
if local_version not in SpecifierSet(SUPPORTED_APPTAINER_VERSIONS):
raise ApptainerVersionException(f'Unsupported version ({version_output}) of apptainer found, '
f'supported versions {SUPPORTED_APPTAINER_VERSIONS}')
Expand Down
2 changes: 1 addition & 1 deletion grpc4bmi/bmi_client_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def check_singularity_version_string(version_output: str) -> bool:
(app, _, version) = version_output.split(' ')
local_version = Version(version)
local_version = Version(version.replace('.el', ''))
if app == 'singularity' and local_version not in SpecifierSet(SUPPORTED_SINGULARITY_VERSIONS):
raise SingularityVersionException(f'Unsupported version ({version_output}) of singularity found, '
f'supported versions {SUPPORTED_SINGULARITY_VERSIONS}')
Expand Down
2 changes: 2 additions & 0 deletions test/test_apptainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Test_check_apptainer_version_string:
('apptainer version 1.0.3'),
('apptainer version 1.1.0-rc.3'),
('apptainer version 1.1.2'),
# From snellius cluster at SURF.
('apptainer version 1.1.5-2.el8'),
])
def test_ok(self, test_input: str):
result = check_apptainer_version_string(test_input)
Expand Down
2 changes: 2 additions & 0 deletions test/test_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ class Test_check_singularity_version_string:
('apptainer version 1.0.3'),
('apptainer version 1.1.0-rc.3'),
('apptainer version 1.1.2'),
# From snellius cluster at SURF.
('apptainer version 1.1.5-2.el8'),
])
def test_ok(self, test_input: str):
result = check_singularity_version_string(test_input)
Expand Down

0 comments on commit 1327b07

Please sign in to comment.