cc7a0602ab
Package-Manager: Portage-3.0.0, Repoman-2.3.23 Signed-off-by: Horea Christian <chr@chymera.eu>
46 lines
2.2 KiB
Diff
46 lines
2.2 KiB
Diff
From b4d57d7ca4359b0990636bbc6091c49706c6ff39 Mon Sep 17 00:00:00 2001
|
|
From: Horea Christian <chr@chymera.eu>
|
|
Date: Fri, 7 Aug 2020 01:12:38 -0400
|
|
Subject: [PATCH] ENH: no more auto-failing on misparsed versions
|
|
|
|
---
|
|
nipype/interfaces/base/core.py | 18 ++++++++++++++++++
|
|
1 file changed, 18 insertions(+)
|
|
|
|
diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py
|
|
index 82da393a84..1e626fe1b5 100644
|
|
--- a/nipype/interfaces/base/core.py
|
|
+++ b/nipype/interfaces/base/core.py
|
|
@@ -276,6 +276,15 @@ def _check_version_requirements(self, trait_object, raise_exception=True):
|
|
version = LooseVersion(str(self.version))
|
|
for name in names:
|
|
min_ver = LooseVersion(str(trait_object.traits()[name].min_ver))
|
|
+ try:
|
|
+ min_ver > version
|
|
+ except TypeError:
|
|
+ iflogger.warning(
|
|
+ 'Nipype is having issues parsing the package version '
|
|
+ f'for Trait {name} ({self.__class__.__name__})'
|
|
+ f'You may want to check whether {version} is larger than {min_ver}'
|
|
+ )
|
|
+ continue
|
|
if min_ver > version:
|
|
unavailable_traits.append(name)
|
|
if not isdefined(getattr(trait_object, name)):
|
|
@@ -293,6 +302,15 @@ def _check_version_requirements(self, trait_object, raise_exception=True):
|
|
version = LooseVersion(str(self.version))
|
|
for name in names:
|
|
max_ver = LooseVersion(str(trait_object.traits()[name].max_ver))
|
|
+ try:
|
|
+ max_ver > version
|
|
+ except TypeError:
|
|
+ iflogger.warning(
|
|
+ 'Nipype is having issues parsing the package version '
|
|
+ f'for Trait {name} ({self.__class__.__name__})'
|
|
+ f'You may want to check whether {version} is smaller than {max_ver}'
|
|
+ )
|
|
+ continue
|
|
if max_ver < version:
|
|
unavailable_traits.append(name)
|
|
if not isdefined(getattr(trait_object, name)):
|