By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

make it so modules do not get loaded when they have unmet dependencies

roundabout,
created on Monday, 18 August 2025, 16:54:34 (1755536074), received on Monday, 18 August 2025, 16:54:38 (1755536078)
Author identity: Vlad <vlad.muntoiu@gmail.com>

14a21b298eead6aca7abae0183b9a9560c6c0beb

main.py

@@ -547,11 +547,14 @@ def load_packages_from_dir(dir_path: Path):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        continue
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if path.is_dir() and (path / "__init__.py").exists():
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    module_name = path.name
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    spec = importlib.util.spec_from_file_location(module_name, path / "__init__.py")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    module = importlib.util.module_from_spec(spec)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    spec.loader.exec_module(module)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    loaded_modules.append(module)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    try:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        module_name = path.name
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        spec = importlib.util.spec_from_file_location(module_name, path / "__init__.py")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        module = importlib.util.module_from_spec(spec)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        spec.loader.exec_module(module)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        loaded_modules.append(module)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    except Exception as e:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        print(f"Failed to load applet module {path.name}: {e}", file=sys.stderr)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    else:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        continue