Skip to content

Extract basilisk.os + shell/sshd/sftp into ic-basilisk-os package #33

@deucalioncodes

Description

@deucalioncodes

Summary

Extract basilisk.os (canister-side OS layer) and the client-side shell tools (exec, shell, sshd, sftp) into a new standalone PyPI package: ic-basilisk-os.

This continues the modularization started in #31 and follows the same pattern as ic-python-db and ic-python-logging.

Motivation

ic-basilisk should be a minimal CDK (@query, @update, ic.*, build, new). The OS layer (entities, wallet, tasks, crypto, FX, vetkeys) and client tools (shell, SFTP, SSHD) are optional and should be a separate package that users install only if needed.

What moves to ic-basilisk-os

Source modules

  • basilisk/os/ic_basilisk_os/ (entities, wallet, task_manager, execution, crypto, vetkeys, fx, tokens, status)
  • basilisk/shell.pyic_basilisk_os/shell.py
  • basilisk/sftp.pyic_basilisk_os/sftp.py
  • basilisk/sshd.pyic_basilisk_os/sshd.py

CLI commands

  • basilisk exec, basilisk shell, basilisk sshd move to ic-basilisk-os
  • basilisk CLI keeps new and build only
  • Backward compat: basilisk shell etc. still work by forwarding to ic_basilisk_os (with helpful error if not installed)

Tests (~390K+ of test code)

  • test_shell.py, test_sftp.py, test_tasks.py, test_wallet.py, test_wallet_hook.py, test_wallet_shell.py, test_crypto.py, test_vetkeys.py, test_fx.py, test_filesystem.py, test_db_shell.py, test_guards.py
  • conftest.py (shared fixtures)
  • test_canister/ and fixtures/

Stays in ic-basilisk

  • basilisk/__init__.py (CDK types, decorators, ic class)
  • basilisk/cli.py (new, build commands + thin forwarding)
  • basilisk/__main__.py (WASM compiler)
  • basilisk/compiler/, basilisk/canisters/, basilisk/templates/
  • test_bundle.py, integration/ tests

Import changes in moved files

  • from basilisk.db import ...from ic_python_db import ...
  • from basilisk.logging import ...from ic_python_logging import ...
  • from basilisk.shell import ...from .shell import ...
  • from basilisk import Async, Principal, ic → stays (CDK)

Dependencies

  • ic-basilisk: install_requires=[] (no required deps)
  • ic-basilisk-os: install_requires=["ic-basilisk", "ic-python-db", "ic-python-logging"], extras_require={"shell": ["asyncssh"]}

Backward compatibility

  • basilisk/os/__init__.py becomes thin re-export: from ic_basilisk_os import *
  • basilisk CLI forwards exec/shell/sshd to ic_basilisk_os with error if not installed

Relates to #31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions