From 27787c0c2565e59366682e5498b3d1409d63f32e Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Sun, 28 Dec 2025 01:51:31 +0800 Subject: [PATCH] fix(visual_bge): move __init__.py to correct location The __init__.py was in research/visual_bge/ but should be in research/visual_bge/visual_bge/ for the package to be properly importable after pip install. Fixes #1545 Signed-off-by: majiayu000 <1835304752@qq.com> --- research/visual_bge/tests/__init__.py | 0 .../visual_bge/tests/test_package_import.py | 39 +++++++++++++++++++ .../visual_bge/{ => visual_bge}/__init__.py | 0 3 files changed, 39 insertions(+) create mode 100644 research/visual_bge/tests/__init__.py create mode 100644 research/visual_bge/tests/test_package_import.py rename research/visual_bge/{ => visual_bge}/__init__.py (100%) diff --git a/research/visual_bge/tests/__init__.py b/research/visual_bge/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/research/visual_bge/tests/test_package_import.py b/research/visual_bge/tests/test_package_import.py new file mode 100644 index 00000000..1c551b93 --- /dev/null +++ b/research/visual_bge/tests/test_package_import.py @@ -0,0 +1,39 @@ +"""Test that the visual_bge package can be properly imported.""" + +import sys +import importlib.util + + +def test_package_structure(): + """Test that visual_bge has proper package structure.""" + import os + package_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + visual_bge_dir = os.path.join(package_dir, "visual_bge") + + # Check that __init__.py exists in visual_bge directory + init_file = os.path.join(visual_bge_dir, "__init__.py") + assert os.path.exists(init_file), f"__init__.py should exist at {init_file}" + + # Check that modeling.py exists + modeling_file = os.path.join(visual_bge_dir, "modeling.py") + assert os.path.exists(modeling_file), f"modeling.py should exist at {modeling_file}" + + +def test_import_visual_bge(): + """Test that visual_bge can be imported after installation.""" + try: + # Try to import the module + import visual_bge + # Check that Visualized_BGE is accessible + assert hasattr(visual_bge, 'Visualized_BGE'), "Visualized_BGE should be importable from visual_bge" + except ImportError: + # If not installed, that's expected in test environment + # Just verify the package structure is correct + pass + + +if __name__ == "__main__": + test_package_structure() + print("Package structure test passed!") + test_import_visual_bge() + print("All tests passed!") diff --git a/research/visual_bge/__init__.py b/research/visual_bge/visual_bge/__init__.py similarity index 100% rename from research/visual_bge/__init__.py rename to research/visual_bge/visual_bge/__init__.py