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"
package = "my_module_lib"
assets = "assets"
# Optional root-private files for `from .utils import ...` in the entrypoint.
sources = ["utils.py"]
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
Add those helper files to sources. CubKit loads them through a private package
name, so they do not collide with MCUB's global utils, lib, or other modules.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cubkit-0.1.0.tar.gz.
File metadata
- Download URL: cubkit-0.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5cdf911d5a0e76cd65dd2fdd69021d25e89b2a8d36cfb89ddc0a8d7179b3a89
|
|
| MD5 |
ce3d2a4cc3643bb0874527a80f326939
|
|
| BLAKE2b-256 |
7caa698974fc89645dbe6c8dfc3cc2356f553aeb4b16ff4943f071584a5cee6b
|
File details
Details for the file cubkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cubkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db5866c2ce93f99225735f3ec6959f323cb89950760ef38d6be17b8bb8b73ca
|
|
| MD5 |
d5fdf2bc9da20032dca75151a7a7fb0d
|
|
| BLAKE2b-256 |
2407c1dbeaa6727aa43f58dd770a726858ff4e15a3ff37429017d01973f4e063
|