Skip to main content

CubKit

CubKit is a small toolkit for MCUB module development.

The first supported workflow is a builder that packs a multi-file module project into a single .py artifact that can still be loaded by MCUB as a normal module.

Install

pip install cubkit

For local development:

pip install -e .

Quick start

cubkit init my_module
cubkit check my_module
cubkit build my_module

The build output is written to my_module/dist/<module_id>.py by default.

Project layout

my_module/
  cubkit.toml
  main.py
  my_module_lib/
    __init__.py
    utils.py
  assets/
    icon.png

cubkit.toml:

id = "my_module"
name = "My Module"
version = "0.1.0"
author = "unknown"
description = "Built with CubKit"
entrypoint = "main.py"
# One package dir or several package dirs are supported.
package = "my_module_lib"
# package = ["my_module_lib", "shared_helpers"]
assets = "assets"
# Optional root-private files for `from .utils import ...` in the entrypoint.
sources = ["utils.py"]
# Optional deterministic build signature comments.
sign = true

CubKit writes MCUB metadata comments into the generated main artifact before the bootstrap code, for example # name:, # version: and optional # author:, # description:, # requires:, # banner_url: and # scop: lines. This keeps function-style modules loadable by MCUB without manually duplicating manifest metadata in main.py.

For class-style modules that inherit from MCUB ModuleBase/Module, CubKit uses the literal class name = "..." attribute for # name: when it is present. This keeps MCUB package metadata, the generated filename and the class-style module name aligned.

Entrypoints may use private relative imports for bundled helpers:

from .utils import helper

CubKit auto-detects simple relative imports from sibling files. You can also add helper files manually to sources. Package directories may be declared as a single string or a list. CubKit loads bundled helpers through a private package name, so they do not collide with MCUB's global utils, lib, or other modules.

When sign = true, CubKit adds deterministic build integrity comments:

# CubKit source sha256: ...
# CubKit payload sha256: ...
# CubKit signature: ...

Generated artifacts also include a lightweight source map/debug block, showing where the entrypoint starts in the generated file and which bundled files were embedded into the payload.

Commands

  • cubkit init <path> creates a starter module project.
  • cubkit check <path> validates the manifest, entrypoint and bundle files.
  • cubkit build <path> writes a single-file MCUB-compatible module artifact.

Build model

CubKit keeps MCUB compatibility by leaving the module entrypoint as normal Python code. Extra package files and assets are embedded into the generated file as a deterministic zip payload. At import time the generated bootstrap extracts the payload into a user cache directory and prepends it to sys.path, so imports such as from my_module_lib.utils import helper work before the original entrypoint code is executed.

The builder never executes module code during validation or build.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubkit-0.1.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubkit-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file cubkit-0.1.1.tar.gz.

File metadata

  • Download URL: cubkit-0.1.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cubkit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f936826c8b867086f83c5082bdff4803fb9fae917916aadff25cb5372b0db88e
MD5 a38e7461f5653dfc4146332b43e25dc8
BLAKE2b-256 2e7555b5b94ea271592d2a4e7107930820dcd5897085998eb934e73af521fb43

See more details on using hashes here.

File details

Details for the file cubkit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cubkit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cubkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad0178708b34d97965faf3266679329f0078b3060c73e72d01edfe4dd4bd2f29
MD5 fd29201b06c9f433e826374539099b6f
BLAKE2b-256 04895de9adbab0652ccffcd2634050fa326f23f357fdb0f3997770b3fd92022d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.6

2 files

0.2.5

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page