Skip to content

ENH: no more auto-failing on misparsed versions #3234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions nipype/interfaces/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand All @@ -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)):
Expand Down