Critical:
- _load_module(): wrap exec_module() in try/except, pop from sys.modules
on failure so broken modules aren't cached
- get_comfyui_path(): add _is_comfyui_directory() check to third (CWD walk)
strategy so a non-ComfyUI directory named "ComfyUI" isn't accepted
- get_node_class_mappings(): return cached sys.modules["nodes"] if already
loaded to avoid re-executing nodes.py and losing init_extra_nodes() state
Suggestions:
- import_custom_nodes(): wrap sys.path filtering in try/finally so path is
always restored even if _load_module("server") raises mid-execution
- render.py: auto-discover helpers from generated_helpers.__all__ instead of
a manually maintained list
- pyproject.toml: remove duplicate ruff dev dependency (kept standard
[project.optional-dependencies] form)
Nitpicks:
- Remove dead imports (types, StringIO) from test_import_path_resolution.py
- Trim trailing blank lines in pyproject.toml
- Tone down _load_module docstring: "eliminates ALL" -> "significantly reduces"
Tests (7 new cases):
- TestLoadModuleFailureCleanup: broken module removed on exec failure, retry
starts fresh
- TestLoadModuleTemp: temp modules purged from sys.modules (success + failure)
- TestRepeatedNodeLoad: repeated _load_module("nodes") returns cached copy
- TestGetComfyuiPathThirdStrategy: fake "ComfyUI" dir rejected
- TestImportCustomNodesSysPathRestoration: sys.path restored after crash
20 lines
610 B
TOML
20 lines
610 B
TOML
[project]
|
|
name = "comfyui-to-python-extension"
|
|
description = "This custom node allows you to generate pure python code from your ComfyUI workflow with the click of a button. Great for rapid experimentation or production deployment."
|
|
version = "2.1.0"
|
|
license = { text = "MIT License" }
|
|
requires-python = ">=3.12"
|
|
dependencies = ["black"]
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["ruff"]
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/pydn/ComfyUI-to-Python-Extension"
|
|
# Used by Comfy Registry https://comfyregistry.org
|
|
|
|
[tool.comfy]
|
|
PublisherId = "pydn"
|
|
DisplayName = "ComfyUI-to-Python-Extension"
|
|
Icon = ""
|