We have this kind of logic for many IOs
try:
import sonpy
HAVE_SONPY = True
except ImportError:
HAVE_SONPY = False
class SomeClass
def __init__(self):
assert HAVE_SONPY, 'sonpy must be installed'
This make importing many modules for every import neo because all extra dependencies are at module level.
I propose to move to "import on demand" logic with this
class SomeClass
def __init__(self):
import sonpy
I propose to do this (it is easy) for the next release 0.11.0
@JuliaSprenger @apdavison : are you OK with this ?