starforge-kernel 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/PKG-INFO +1 -1
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/pyproject.toml +31 -31
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/__init__.py +86 -86
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/PKG-INFO +1 -1
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/README.md +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/setup.cfg +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/__init__.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/checkpoints.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/figures.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/previews.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/provenance.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/runner.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/serializers.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/core/spec.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/index/__init__.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/index/scanner.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/kernel/__init__.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/kernel/__main__.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/kernel/server.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/kernel/worker.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge/mcp.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/SOURCES.txt +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/dependency_links.txt +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/requires.txt +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/top_level.txt +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_decorator.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_figures.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_indexer.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_kernel_protocol.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_m1_features.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_mcp_module.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_previews.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_provenance.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_runner_end_to_end.py +0 -0
- {starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/tests/test_serializers.py +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=68", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
# PyPI name `starforge` is squatted by a dormant Galaxy tool (see DESIGN.md §4);
|
|
7
|
-
# the import name is still `starforge`.
|
|
8
|
-
name = "starforge-kernel"
|
|
9
|
-
version = "0.1.
|
|
10
|
-
description = "*Forge — pipeline canvas, checkpointing, and stale/hydrate execution for the repo you already have open"
|
|
11
|
-
readme = "README.md"
|
|
12
|
-
authors = [{ name = "Jonathan Potter" }]
|
|
13
|
-
license = "Apache-2.0"
|
|
14
|
-
requires-python = ">=3.10"
|
|
15
|
-
# Intentionally empty: the decorator must import in microseconds inside user
|
|
16
|
-
# production code, and the kernel runs stdlib-only. pandas/numpy/pyarrow are
|
|
17
|
-
# probed lazily in workers and used only if the workspace env provides them.
|
|
18
|
-
dependencies = []
|
|
19
|
-
|
|
20
|
-
[project.urls]
|
|
21
|
-
Homepage = "https://github.com/Jonpot/forge"
|
|
22
|
-
|
|
23
|
-
[project.optional-dependencies]
|
|
24
|
-
dev = ["pytest>=8.0", "pandas>=2.0", "pyarrow>=15.0", "numpy>=1.26"]
|
|
25
|
-
mcp = ["mcp>=1.8"]
|
|
26
|
-
|
|
27
|
-
[tool.setuptools.packages.find]
|
|
28
|
-
where = ["src"]
|
|
29
|
-
|
|
30
|
-
[tool.pytest.ini_options]
|
|
31
|
-
testpaths = ["tests"]
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
# PyPI name `starforge` is squatted by a dormant Galaxy tool (see DESIGN.md §4);
|
|
7
|
+
# the import name is still `starforge`.
|
|
8
|
+
name = "starforge-kernel"
|
|
9
|
+
version = "0.1.2"
|
|
10
|
+
description = "*Forge — pipeline canvas, checkpointing, and stale/hydrate execution for the repo you already have open"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
authors = [{ name = "Jonathan Potter" }]
|
|
13
|
+
license = "Apache-2.0"
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
# Intentionally empty: the decorator must import in microseconds inside user
|
|
16
|
+
# production code, and the kernel runs stdlib-only. pandas/numpy/pyarrow are
|
|
17
|
+
# probed lazily in workers and used only if the workspace env provides them.
|
|
18
|
+
dependencies = []
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://github.com/Jonpot/forge"
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
dev = ["pytest>=8.0", "pandas>=2.0", "pyarrow>=15.0", "numpy>=1.26"]
|
|
25
|
+
mcp = ["mcp>=1.8"]
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
where = ["src"]
|
|
29
|
+
|
|
30
|
+
[tool.pytest.ini_options]
|
|
31
|
+
testpaths = ["tests"]
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
"""*Forge — pipeline canvas for the repo you already have open.
|
|
2
|
-
|
|
3
|
-
This top-level module is the entire public surface that user code touches.
|
|
4
|
-
It must import in microseconds and depend on nothing: the decorator lives in
|
|
5
|
-
production codebases and has to be free. Everything heavy (indexer, engine,
|
|
6
|
-
kernel) lives in submodules that only *Forge itself* imports.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
__version__ = "0.1.
|
|
12
|
-
|
|
13
|
-
__all__ = ["block", "progress", "BLOCK_ATTR"]
|
|
14
|
-
|
|
15
|
-
#: Attribute set on decorated functions. The AST indexer matches the decorator
|
|
16
|
-
#: syntactically and never imports user code; this runtime tag exists so user
|
|
17
|
-
#: code and future runtime introspection can also recognize blocks.
|
|
18
|
-
BLOCK_ATTR = "__starforge_block__"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def block(fn=None, *, label=None, category=None, outputs=None):
|
|
22
|
-
"""Register a function as a *Forge block.
|
|
23
|
-
|
|
24
|
-
Usable bare or with keyword arguments::
|
|
25
|
-
|
|
26
|
-
@block
|
|
27
|
-
def clean(raw: pd.DataFrame) -> pd.DataFrame: ...
|
|
28
|
-
|
|
29
|
-
@block(label="Clean AUC Matrix", category="QC", outputs=("clean", "stats"))
|
|
30
|
-
def clean_auc(raw, min_coverage: float = 0.8): ...
|
|
31
|
-
|
|
32
|
-
The decorated function is returned unchanged — behavior under pytest, in
|
|
33
|
-
CI, or in production is identical whether or not *Forge is anywhere near.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
label: Palette display name. Defaults to the function name, title-cased.
|
|
37
|
-
category: Palette grouping. Defaults to the defining module's path.
|
|
38
|
-
outputs: Names for multiple return values (function must return a tuple
|
|
39
|
-
of the same length). Defaults to a single output named "output".
|
|
40
|
-
|
|
41
|
-
Note for palette metadata: the indexer reads ``label``/``category``/
|
|
42
|
-
``outputs`` from the *source*, so they must be literals at the decoration
|
|
43
|
-
site to appear in the palette.
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
|
-
def apply(f):
|
|
47
|
-
setattr(
|
|
48
|
-
f,
|
|
49
|
-
BLOCK_ATTR,
|
|
50
|
-
{
|
|
51
|
-
"label": label,
|
|
52
|
-
"category": category,
|
|
53
|
-
"outputs": tuple(outputs) if outputs is not None else None,
|
|
54
|
-
},
|
|
55
|
-
)
|
|
56
|
-
return f
|
|
57
|
-
|
|
58
|
-
if fn is not None:
|
|
59
|
-
return apply(fn)
|
|
60
|
-
return apply
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
#: Installed by the *Forge run worker around each block call; None everywhere
|
|
64
|
-
#: else, which keeps progress() a guaranteed no-op in pytest/CI/production.
|
|
65
|
-
_progress_hook = None
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def progress(current=None, total=None, label=None):
|
|
69
|
-
"""Report block progress to the *Forge canvas.
|
|
70
|
-
|
|
71
|
-
Call freely inside a block::
|
|
72
|
-
|
|
73
|
-
for i, chunk in enumerate(chunks):
|
|
74
|
-
progress(i + 1, len(chunks), "fitting folds")
|
|
75
|
-
...
|
|
76
|
-
|
|
77
|
-
Outside a *Forge run this does nothing and costs one attribute read —
|
|
78
|
-
safe to leave in production code. Any combination of arguments works:
|
|
79
|
-
(current, total) renders a determinate bar, label alone updates the text.
|
|
80
|
-
"""
|
|
81
|
-
hook = _progress_hook
|
|
82
|
-
if hook is not None:
|
|
83
|
-
try:
|
|
84
|
-
hook(current, total, label)
|
|
85
|
-
except Exception:
|
|
86
|
-
pass # progress must never break user code
|
|
1
|
+
"""*Forge — pipeline canvas for the repo you already have open.
|
|
2
|
+
|
|
3
|
+
This top-level module is the entire public surface that user code touches.
|
|
4
|
+
It must import in microseconds and depend on nothing: the decorator lives in
|
|
5
|
+
production codebases and has to be free. Everything heavy (indexer, engine,
|
|
6
|
+
kernel) lives in submodules that only *Forge itself* imports.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.2"
|
|
12
|
+
|
|
13
|
+
__all__ = ["block", "progress", "BLOCK_ATTR"]
|
|
14
|
+
|
|
15
|
+
#: Attribute set on decorated functions. The AST indexer matches the decorator
|
|
16
|
+
#: syntactically and never imports user code; this runtime tag exists so user
|
|
17
|
+
#: code and future runtime introspection can also recognize blocks.
|
|
18
|
+
BLOCK_ATTR = "__starforge_block__"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def block(fn=None, *, label=None, category=None, outputs=None):
|
|
22
|
+
"""Register a function as a *Forge block.
|
|
23
|
+
|
|
24
|
+
Usable bare or with keyword arguments::
|
|
25
|
+
|
|
26
|
+
@block
|
|
27
|
+
def clean(raw: pd.DataFrame) -> pd.DataFrame: ...
|
|
28
|
+
|
|
29
|
+
@block(label="Clean AUC Matrix", category="QC", outputs=("clean", "stats"))
|
|
30
|
+
def clean_auc(raw, min_coverage: float = 0.8): ...
|
|
31
|
+
|
|
32
|
+
The decorated function is returned unchanged — behavior under pytest, in
|
|
33
|
+
CI, or in production is identical whether or not *Forge is anywhere near.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
label: Palette display name. Defaults to the function name, title-cased.
|
|
37
|
+
category: Palette grouping. Defaults to the defining module's path.
|
|
38
|
+
outputs: Names for multiple return values (function must return a tuple
|
|
39
|
+
of the same length). Defaults to a single output named "output".
|
|
40
|
+
|
|
41
|
+
Note for palette metadata: the indexer reads ``label``/``category``/
|
|
42
|
+
``outputs`` from the *source*, so they must be literals at the decoration
|
|
43
|
+
site to appear in the palette.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def apply(f):
|
|
47
|
+
setattr(
|
|
48
|
+
f,
|
|
49
|
+
BLOCK_ATTR,
|
|
50
|
+
{
|
|
51
|
+
"label": label,
|
|
52
|
+
"category": category,
|
|
53
|
+
"outputs": tuple(outputs) if outputs is not None else None,
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
return f
|
|
57
|
+
|
|
58
|
+
if fn is not None:
|
|
59
|
+
return apply(fn)
|
|
60
|
+
return apply
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
#: Installed by the *Forge run worker around each block call; None everywhere
|
|
64
|
+
#: else, which keeps progress() a guaranteed no-op in pytest/CI/production.
|
|
65
|
+
_progress_hook = None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def progress(current=None, total=None, label=None):
|
|
69
|
+
"""Report block progress to the *Forge canvas.
|
|
70
|
+
|
|
71
|
+
Call freely inside a block::
|
|
72
|
+
|
|
73
|
+
for i, chunk in enumerate(chunks):
|
|
74
|
+
progress(i + 1, len(chunks), "fitting folds")
|
|
75
|
+
...
|
|
76
|
+
|
|
77
|
+
Outside a *Forge run this does nothing and costs one attribute read —
|
|
78
|
+
safe to leave in production code. Any combination of arguments works:
|
|
79
|
+
(current, total) renders a determinate bar, label alone updates the text.
|
|
80
|
+
"""
|
|
81
|
+
hook = _progress_hook
|
|
82
|
+
if hook is not None:
|
|
83
|
+
try:
|
|
84
|
+
hook(current, total, label)
|
|
85
|
+
except Exception:
|
|
86
|
+
pass # progress must never break user code
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/requires.txt
RENAMED
|
File without changes
|
{starforge_kernel-0.1.0 → starforge_kernel-0.1.2}/src/starforge_kernel.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|