Skip to content

Checking testing dependencies at runtime #2680

Closed
@TheChymera

Description

@TheChymera

Summary

It appears =nipype-1.1.1 is checking at least one testing dependency at runtime and crashing all of my nodes if it is not present.
This really shouldn't be happening, especially not for a testing dep.
Shouldn't things just fail if+when the import statement fails?
I would like to sed the package for the 1.1.1 release to fix this behaviour, but I was unable to find the section of the code which does this.

Actual behavior

chymera@clusterhost ~/ni_data/ofM.dr/preprocessing $ nipypecli crash crashdump/crash-20180810-182150-chymera-get_s_scan.a177-134d9fcf-b564-4c40-a0c5-a0b398b38ac8.pklz
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/nipypecli", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 3098, in <module>
    @_call_aside
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib64/python2.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pytest-xdist' distribution was not found and is required by nipype

Platform details:

(nipype.get_info())"
{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.1',
 'nibabel_version': '2.3.0',
 'nipype_version': '1.1.1',
 'numpy_version': '1.14.5',
 'pkg_path': '/usr/lib64/python2.7/site-packages/nipype',
 'scipy_version': '1.1.0',
 'sys_executable': '/usr/lib/python-exec/python2.7/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.15 (default, Aug  9 2018, 12:12:11) \n[GCC 6.4.0]',
 'traits_version': '4.6.0'}

Execution environment

  • My python environment outside container

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions