How to use the jupyterlab.commands.build function in jupyterlab

To help you get started, we’ve selected a few jupyterlab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / jupyterlab / main.py View on Github external
except Exception:
                pass
            print(description)
            return

    if subcommand == 'launch':
        sys.argv = sys.argv[1:]
        LabApp.launch_instance()
    elif subcommand == 'install_extension':
        [install_extension(arg) for arg in args]
    elif subcommand == 'list_extensions':
        [print(ext) for ext in list_extensions()]
    elif subcommand == 'uninstall_extension':
        [uninstall_extension(arg) for arg in args]
    elif subcommand == 'build':
        build()
    else:
        print('unknown subcommand "%s"' % subcommand)
        sys.exit(1)
github jupyterlab / jupyterlab / jupyterlab / labapp.py View on Github external
def start(self):
        command = 'build:prod' if not self.dev_build else 'build'
        app_dir = self.app_dir or get_app_dir()
        self.log.info('JupyterLab %s', version)
        self.log.info('Building in %s', app_dir)
        build(app_dir=app_dir, name=self.name, version=self.version,
              command=command, logger=self.log)
github jupyterlab / jupyterlab / jupyterlab / labextensions.py View on Github external
def start(self):
        if self.app_dir and self.app_dir.startswith(HERE):
            raise ValueError('Cannot run lab extension commands in core app')
        with self.debug_logging():
            ans = self.run_task()
            if ans and self.should_build:
                command = 'build:prod' if not self.dev_build else 'build'
                build(app_dir=self.app_dir, clean_staging=self.should_clean,
                      logger=self.log, command=command)
github jupyterlab / jupyterlab / jupyterlab / handlers / build_handler.py View on Github external
def _run_build(self, app_dir, logger, kill_event):
        kwargs = dict(app_dir=app_dir, logger=logger, kill_event=kill_event, command='build')
        try:
            return build(**kwargs)
        except Exception as e:
            if self._kill_event.is_set():
                return
            self.log.warn('Build failed, running a clean and rebuild')
            clean(app_dir)
            return build(**kwargs)