# Path: lamvery/log.py
# def get_logger(name):
#     global logger
#     if logger is None:
#         logger = logging.getLogger(name)
#         logger.setLevel(logging.INFO)
#         handler = ColoredStreamHandler(stream=sys.stderr)
#         handler.setLevel(logging.INFO)
#         handler.setFormatter(
#             logging.Formatter('%(name)s: %(message)s'))
#         logger.removeHandler(handler)
#         logger.addHandler(handler)
#     return logger
# 
# Path: lamvery/utils.py
# def run_commands(commands, working_dir=os.getcwd()):
#     cwd = os.getcwd()
#     os.chdir(working_dir)
# 
#     for c in commands:
#         try:
#             subprocess.check_output(
#                 c, stderr=subprocess.STDOUT, shell=True)
#         except subprocess.CalledProcessError as e:
#             os.chdir(cwd)
#             raise Exception(e.output)
# 
#     os.chdir(cwd)


import os
import sys
import tempfile
import shutil
import re
import warnings
import json
import lamvery.secret
import lamvery.config
from zipfile import PyZipFile, ZIP_DEFLATED
from lamvery.log import get_logger
from lamvery.utils import run_commands
    '.git',
    '__pycache__'
]

PYFILE_PATTERN = re.compile('.+\.py.?$')


class Builder:

    def __init__(
        self,
        filename,
        function_filename=None,
        single_file=False,
        no_libs=False,
        secret={},
        exclude=[],
        runtime=lamvery.config.RUNTIME_PY_27,
        env=None,
        clean_build=False,
        hooks={}
    ):
        self._filename = filename
        self._function_filename = function_filename
        self._tmpdir = tempfile.mkdtemp(suffix='lamvery')
        self._zippath = os.path.join(self._tmpdir, self._filename)
        self._secret = secret
        self._single_file = single_file
        self._no_libs = no_libs
        self._exclude = exclude

# Path: lamvery/log.py
# def get_logger(name):
#     global logger
#     if logger is None:
#         logger = logging.getLogger(name)
#         logger.setLevel(logging.INFO)
#         handler = ColoredStreamHandler(stream=sys.stderr)
#         handler.setLevel(logging.INFO)
#         handler.setFormatter(
#             logging.Formatter('%(name)s: %(message)s'))
#         logger.removeHandler(handler)
#         logger.addHandler(handler)
#     return logger
# 
# Path: lamvery/utils.py
# def run_commands(commands, working_dir=os.getcwd()):
#     cwd = os.getcwd()
#     os.chdir(working_dir)
# 
#     for c in commands:
#         try:
#             subprocess.check_output(
#                 c, stderr=subprocess.STDOUT, shell=True)
#         except subprocess.CalledProcessError as e:
#             os.chdir(cwd)
#             raise Exception(e.output)
# 
#     os.chdir(cwd)


# Path: lamvery/build.py
import os
import sys
import tempfile
import shutil
import re
import warnings
import json
import lamvery.secret
import lamvery.config
from zipfile import PyZipFile, ZIP_DEFLATED
from lamvery.log import get_logger
from lamvery.utils import run_commands

    '.git',
    '__pycache__'
]

PYFILE_PATTERN = re.compile('.+\.py.?$')


class Builder:

    def __init__(
        self,
        filename,
        function_filename=None,
        single_file=False,
        no_libs=False,
        secret={},
        exclude=[],
        runtime=lamvery.config.RUNTIME_PY_27,
        env=None,
        clean_build=False,
        hooks={}
    ):
        self._filename = filename
        self._function_filename = function_filename
        self._tmpdir = tempfile.mkdtemp(suffix='lamvery')
        self._zippath = os.path.join(self._tmpdir, self._filename)
        self._secret = secret
        self._single_file = single_file
        self._no_libs = no_libs
        self._exclude = exclude

        self._runtime = runtime