1
0
mirror of synced 2025-12-26 05:05:18 -05:00

read module env variables in main (#735)

This commit is contained in:
Charles
2020-10-29 10:13:46 -07:00
committed by GitHub
parent f408bce2dc
commit 2f238d6d35
2 changed files with 11 additions and 12 deletions

View File

@@ -33,11 +33,6 @@ from airbyte_protocol import AirbyteMessage, Status, Type
from .integration import ConfigContainer, Source
from .logger import AirbyteLogger
impl_module = os.environ.get("AIRBYTE_IMPL_MODULE", Source.__module__)
impl_class = os.environ.get("AIRBYTE_IMPL_PATH", Source.__name__)
module = importlib.import_module(impl_module)
impl = getattr(module, impl_class)
logger = AirbyteLogger()
@@ -130,10 +125,16 @@ class AirbyteEntrypoint(object):
def launch(source, args):
AirbyteEntrypoint(source).start(args)
def main():
impl_module = os.environ.get("AIRBYTE_IMPL_MODULE", Source.__module__)
impl_class = os.environ.get("AIRBYTE_IMPL_PATH", Source.__name__)
module = importlib.import_module(impl_module)
impl = getattr(module, impl_class)
# set up and run entrypoint
source = impl()