mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-10 03:37:44 +02:00
[eric] Mac publish fixes: NODE_OPTIONS heap + rsync excludes for user-state and template_cache
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"""Module alias — exposes the `debug()` function under the `swarm_debug`
|
||||
name so code that does `from swarm_debug import debug` resolves to the
|
||||
same OpenSwarm-bundled package that the legacy `import debug` path
|
||||
already serves.
|
||||
|
||||
`debug.py` ends with `sys.modules[__name__] = debug`, which replaces the
|
||||
module object with the bare function. That trick lets OpenSwarm's own
|
||||
code write `import debug; debug(x)` (the imported name binds to the
|
||||
function directly), but it means `from debug import debug` doesn't work
|
||||
(you can't attribute-walk a function). This shim captures the function
|
||||
via `import debug` (which now binds to the function thanks to the
|
||||
sys.modules swap) and re-exports it as a normal module attribute, so
|
||||
the more conventional `from swarm_debug import debug` pattern works.
|
||||
"""
|
||||
|
||||
import debug as _debug # noqa: F401 — `_debug` is actually the function
|
||||
|
||||
# Re-export as a module attribute so `from swarm_debug import debug` resolves.
|
||||
debug = _debug
|
||||
|
||||
__all__ = ["debug"]
|
||||
Reference in New Issue
Block a user