jamess-mbp:tmp jtdub$ cat test/__init__.py
from os.path import dirname, basename, isfile, join
import glob
import importlib
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
custom_modules = [ "test." + basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
plugin_module = importlib.import_module(custom_modules[0])
jamess-mbp:tmp jtdub$ ls test
__init__.py __pycache__ test1.py test2.py
__init__.pyc test0.pyc test1.pyc test2.pyc
jamess-mbp:tmp jtdub$ cat test.py
#!/usr/bin/env python3
import test
plugin = test.plugin_module
t = plugin.TestClass()
t.run()