# Path: sio/workers/util.py
# def first_entry_point(group, name=None):
#     for ep in pkg_resources.iter_entry_points(group, name):
#         try:
#             return ep.load()
#         except ImportError as e:
#             logger.warning(
#                 'ImportError: %s: %s'
#                 % (
#                     ep,
#                     e,
#                 )
#             )
#             pass
#     raise RuntimeError("Module providing '%s:%s' not found" % (group, name or ''))
# 
# def json_dumps(obj, **kwargs):
#     """Python 3 and 2 compatible json.dump."""
#     kwargs.setdefault('cls', CompatibleJSONEncoder)
#     return json.dumps(obj, **kwargs)


import sys
import os.path
from sio.workers.util import first_entry_point, json_dumps
from __future__ import absolute_import
from __future__ import print_function



def run(environ):
    if 'compiler' not in environ:
        _, extension = os.path.splitext(environ['source_file'])
        environ['compiler'] = 'default-' + extension[1:].lower()
    compiler = first_entry_point('sio.compilers', environ['compiler'].split('.')[0])

# Path: sio/workers/util.py
# def first_entry_point(group, name=None):
#     for ep in pkg_resources.iter_entry_points(group, name):
#         try:
#             return ep.load()
#         except ImportError as e:
#             logger.warning(
#                 'ImportError: %s: %s'
#                 % (
#                     ep,
#                     e,
#                 )
#             )
#             pass
#     raise RuntimeError("Module providing '%s:%s' not found" % (group, name or ''))
# 
# def json_dumps(obj, **kwargs):
#     """Python 3 and 2 compatible json.dump."""
#     kwargs.setdefault('cls', CompatibleJSONEncoder)
#     return json.dumps(obj, **kwargs)


# Path: sio/compilers/job.py
import sys
import os.path
from sio.workers.util import first_entry_point, json_dumps

from __future__ import absolute_import
from __future__ import print_function



def run(environ):
    if 'compiler' not in environ:
        _, extension = os.path.splitext(environ['source_file'])
        environ['compiler'] = 'default-' + extension[1:].lower()
    compiler = first_entry_point('sio.compilers', environ['compiler'].split('.')[0])

    environ = compiler(environ)