From 602d5e1ef86d97400143df3edf8d96faa03a63e9 Mon Sep 17 00:00:00 2001 From: Tasha Upchurch Date: Fri, 7 Jul 2023 02:59:59 -0400 Subject: [PATCH] aider: Fixed relative import error in test_git.py. # Context: USER: I ran this command: python E:/git/ComfyUI/custom_nodes/EternalKernelLiteGraphNodes/tests/test_git.py And got this output: Total VRAM 10239 MB, total RAM 98225 MB Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3080 ETK> Failed to import comfy.samplers, assuming no comfyui skipping SD related nodes Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention ETK> advanced clip not found, skipping it +--------------------- Traceback (most recent call last) ---------------------+ | E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py:6 | | in | | | | 3 import os | | 4 sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.pat | | 5 try: | | > 6 from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRep | | 7 except: | | 8 from ..git import CreateRepoNode | | 9 | | | | E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\git.py:1 in | | | | | | > 1 import giturlparse | | 2 import git | | 3 | | 4 | +-----------------------------------------------------------------------------+ ModuleNotFoundError: No module named 'giturlparse' During handling of the above exception, another exception occurred: +--------------------- Traceback (most recent call last) ---------------------+ | E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py:8 | | in | | | | 5 try: | | 6 from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRep | | 7 except: | | > 8 from ..git import CreateRepoNode | | 9 | | 10 | | 11 | +-----------------------------------------------------------------------------+ ImportError: attempted relative import with no known parent package --- tests/test_git.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/test_git.py b/tests/test_git.py index 43134e7..341c230 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -3,11 +3,9 @@ import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))) try: - from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode -except: - from ..git import CreateRepoNode - - + from custom_nodes.git import CreateRepoNode +except ImportError: + from custom_nodes.git import CreateRepoNode class TestCreateRepoNode(unittest.TestCase): def test_create_repo(self): @@ -15,6 +13,5 @@ class TestCreateRepoNode(unittest.TestCase): node.create_repo(subdirectory="my_repo") # Add assertions or additional test logic here - if __name__ == "__main__": unittest.main()