Skip to content

Commit 9557f49

Browse files
committed
[chore]: fix linting problems
1 parent 35ef465 commit 9557f49

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

invokeai/app/invocations/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import importlib
12
from pathlib import Path
23

3-
# import any folders within 'custom_nodes/src/' as modules (for better devcontainer development).
4-
from .custom_nodes import * # type: ignore[reportUnusedImport]
4+
# import any devcontainer mounted nodes within 'custom_nodes' as modules (devcontainer mounts them here instead of /invokeai/nodes to avoid confusing development tools like the debugger or pylance or whatever).
5+
importlib.import_module("invokeai.app.invocations.custom_nodes")
56

67
# add core nodes to __all__
78
python_files = filter(lambda f: not f.name.startswith("_"), Path(__file__).parent.glob("*.py"))

invokeai/app/invocations/custom_nodes/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88
logger = InvokeAILogger.get_logger()
99

1010
# Compute the path to `src/` directory
11-
here = os.path.dirname(__file__)
12-
src_path = os.path.join(here, 'src')
11+
src_path = os.path.join(os.path.dirname(__file__), 'src')
1312

1413
# Tell Python to treat src/ as part of this package
1514
# (so that pkgutil.iter_modules will see the sub‑packages)
1615
sys.path.insert(0, str(src_path))
1716

1817
loaded = 0
1918
# Iterate over every entry in src/, and for each package, import it
20-
for finder, pkg_name, is_pkg in pkgutil.iter_modules([src_path]):
19+
for _, pkg_name, is_pkg in pkgutil.iter_modules([src_path]):
2120
if not is_pkg:
2221
continue
2322

@@ -26,11 +25,11 @@
2625
continue
2726

2827
try:
29-
logger.info(f"Importing custom node package {pkg_name!r}")
28+
logger.info(f"Mounting custom-node package for development {pkg_name!r}")
3029
importlib.import_module(pkg_name)
3130
loaded += 1
3231
except Exception as e:
3332
logger.error(f"Failed to import {pkg_name!r}: {e}")
3433

3534
if loaded:
36-
logger.info(f"Loaded {loaded} custom node package(s) from {src_path!r}")
35+
logger.info(f"Loaded {loaded} custom-node package(s) from {src_path!r}")

0 commit comments

Comments
 (0)