-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI enhancement + Bump versions (#23)
* docs: jupyterlab * fix: webpack * chore: factor envs cli * chore: use run_url * chore: benchmarks * chore: envs * chore: utils * fix: help * fix: kernel type * chore: use pathname * chore: log info * chore: datalayer run url * fix: app * fix: webpack * bump version * bump: version * chore: benchmarks * chore: bump version * bump: version * lint * cli: add example * chore: revert back to jupyterlab 4.0.9 * bump * tune: webpack * bump * fix: build * fix: build
- Loading branch information
Showing
47 changed files
with
543 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Datalayer Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
from rich.console import Console | ||
from rich.table import Table | ||
|
||
def display_me(me: dict) -> None: | ||
"""Display a my profile.""" | ||
table = Table(title="Profile") | ||
table.add_column("ID", style="magenta", no_wrap=True) | ||
table.add_column("Handle", style="cyan", no_wrap=True) | ||
table.add_column("First name", style="green", no_wrap=True) | ||
table.add_column("Last name", style="green", no_wrap=True) | ||
table.add_row( | ||
me["uid"], | ||
me["handle_s"], | ||
me["first_name_t"], | ||
me["last_name_t"], | ||
) | ||
console = Console() | ||
console.print(table) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright (c) Datalayer Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Datalayer Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
from datalayer_core.application import NoStart | ||
|
||
from datalayer_core.cli.base import DatalayerCLIBaseApp | ||
from datalayer_core.benchmarks.web.webapp import BenchmarksWebApp | ||
|
||
class BenchmarksApp(DatalayerCLIBaseApp): | ||
"""An application to run benchmarks.""" | ||
|
||
description = """ | ||
An application to run benchmarks. | ||
""" | ||
|
||
_requires_auth = False | ||
|
||
subcommands = { | ||
"web": (BenchmarksWebApp, BenchmarksWebApp.description.splitlines()[0]), | ||
} | ||
|
||
def start(self): | ||
try: | ||
super().start() | ||
self.log.info(f"One of `{'` `'.join(BenchmarksApp.subcommands.keys())}` must be specified.") | ||
self.exit(1) | ||
except NoStart: | ||
pass | ||
self.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright (c) Datalayer Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) Datalayer Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
import sys | ||
|
||
from datalayer_core.cli.base import DatalayerCLIBaseApp | ||
from datalayer_core.serverapplication import launch_new_instance | ||
|
||
|
||
class BenchmarksWebApp(DatalayerCLIBaseApp): | ||
"""An application to show the benchmarks webapp.""" | ||
|
||
description = """ | ||
An application to show the benchmarks webapp. | ||
""" | ||
|
||
_requires_auth = False | ||
|
||
def start(self): | ||
"""Start the app.""" | ||
if len(self.extra_args) > 1: # pragma: no cover | ||
self.log.warning("Too many arguments were provided for kernel create.") | ||
self.print_help() | ||
self.exit(1) | ||
self.clear_instance() | ||
sys.argv = [ | ||
'', | ||
'--ServerApp.disable_check_xsrf=True', | ||
'--DatalayerExtensionApp.benchmarks=True', | ||
f'--DatalayerExtensionApp.run_url={self.run_url}', | ||
] | ||
launch_new_instance() |
Oops, something went wrong.