Skip to content

Commit 3fcc901

Browse files
authored
Merge pull request #135 from shenald-dev/jules/apex-forge-maintainability-2430603911627901522
Maintainability & DX: Root Exports and Dynamic API Versioning
2 parents b4b0596 + 40fdda0 commit 3fcc901

6 files changed

Lines changed: 27 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,7 @@ All notable changes to this project will be documented in this file.
335335

336336
## [0.1.31] - 2026-05-31
337337
* **Bugfix:** Auto-resolved git merge conflict syntax errors, ensuring safe dependency fetching logic and proper code indentations.
338+
339+
## 2026-06-01 - v0.1.32
340+
341+
* **Maintainability:** Exported core engine primitives at package root for better DX, and dynamically resolved FastAPI app version to prevent drift.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "catalyst"
3-
version = "0.1.31"
3+
version = "0.1.32"
44
description = "High-performance workflow engine for complex pipelines. Parallel DAG execution, <1s sorts, zero bloat."
55
authors = [ { name = "shenald-dev", email = "bot@shenald.dev" }
66
]

src/catalyst/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .domain.engine import WorkflowEngine, TaskError
2+
3+
__all__ = ["WorkflowEngine", "TaskError"]

src/catalyst/domain/engine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,15 @@ def add_task(
7373
self.tasks[name] = func
7474
self._timeouts[name] = timeout
7575

76+
# Check if the function is asynchronous, correctly unwrapping partials
77+
# and checking __call__ for async callable objects.
7678
is_async = inspect.iscoroutinefunction(func)
7779
if not is_async:
7880
base_func = func
7981
while isinstance(base_func, functools.partial):
8082
base_func = base_func.func
83+
# inspect.iscoroutinefunction naturally handles functions, methods, and builtins.
84+
# Only objects implementing __call__ might incorrectly return False.
8185
if not isinstance(
8286
base_func,
8387
(types.FunctionType, types.MethodType, types.BuiltinFunctionType),

src/catalyst/presentation/api/main.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22

33
from fastapi import FastAPI
44
from pydantic import BaseModel
5-
from catalyst.domain.engine import TaskError, WorkflowEngine
5+
from importlib.metadata import version, PackageNotFoundError
6+
7+
try:
8+
__version__ = version("catalyst")
9+
except PackageNotFoundError:
10+
__version__ = "0.0.0-dev"
11+
12+
from catalyst import TaskError, WorkflowEngine
613

714
app = FastAPI(
815
title="Catalyst Workflow API",
916
description="High-performance DAG execution engine interface",
10-
version="0.1.29",
17+
version=__version__,
1118
)
1219

20+
1321
class StatusResponse(BaseModel):
1422
status: str
1523
message: str
@@ -51,4 +59,4 @@ def failing_task() -> str:
5159
else:
5260
serializable_results[task_name] = result
5361

54-
return {"status": "success", "results": serializable_results}
62+
return {"status": "success", "results": serializable_results}

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)