diff --git a/enterprise_gateway/__init__.py b/enterprise_gateway/__init__.py index 86ef456ff..76586385c 100644 --- a/enterprise_gateway/__init__.py +++ b/enterprise_gateway/__init__.py @@ -1,5 +1,8 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -"""Entrypoint for the enterprise gateway package.""" -from .enterprisegatewayapp import launch_instance from ._version import __version__ + +"""Lazy-loading entrypoint for the enterprise gateway package.""" +def launch_instance(*args, **kwargs): + from enterprise_gateway.enterprisegatewayapp import launch_instance + launch_instance(*args, **kwargs) diff --git a/scripts/jupyter-enterprisegateway b/scripts/jupyter-enterprisegateway deleted file mode 100644 index 85ca32d4b..000000000 --- a/scripts/jupyter-enterprisegateway +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. -import enterprise_gateway - -if __name__ == '__main__': - enterprise_gateway.launch_instance() diff --git a/setup.py b/setup.py index 052385d38..9482e091d 100644 --- a/setup.py +++ b/setup.py @@ -43,9 +43,6 @@ 'enterprise_gateway.services.processproxies', 'enterprise_gateway.services.sessions' ], - scripts=[ - 'scripts/jupyter-enterprisegateway' - ], install_requires=[ 'docker>=3.5.0', 'future', @@ -83,7 +80,7 @@ # setupstools turns entrypoint scripts into executables on windows setup_args['entry_points'] = { 'console_scripts': [ - 'jupyter-enterprisegateway = enterprise_gateway:launch_instance' + 'jupyter-enterprisegateway = enterprise_gateway.enterprisegatewayapp:launch_instance' ] } # Don't bother installing the .py scripts if if we're using entrypoints