Buckets:

download
raw
1.07 kB
"""CLI for Calkit developers, hidden from the typical help menu."""
from __future__ import annotations
import subprocess
import sys
from typing import Annotated
import typer
import calkit
dev_app = typer.Typer(no_args_is_help=True)
@dev_app.command(
name="python",
add_help_option=False,
context_settings={
"ignore_unknown_options": True,
"allow_extra_args": True,
},
)
def run_python(
ctx: typer.Context,
help: Annotated[bool, typer.Option("-h", "--help")] = False,
):
"""Start an Python shell in Calkit's environment."""
subprocess.run([sys.executable] + sys.argv[3:])
@dev_app.command(
name="ipython",
add_help_option=False,
context_settings={
"ignore_unknown_options": True,
"allow_extra_args": True,
},
)
def run_ipython(
ctx: typer.Context,
help: Annotated[bool, typer.Option("-h", "--help")] = False,
):
"""Start an IPython shell in Calkit's environment."""
from IPython import start_ipython
start_ipython(argv=sys.argv[3:], user_ns={"calkit": calkit})

Xet Storage Details

Size:
1.07 kB
·
Xet hash:
03e9801263fe465fce711f1dad8fa725aab38268362425997dcf5d27224f508f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.