#!/usr/bin/env python3 """ Test script to verify AI Resume Screener installation """ import sys import importlib def test_import(module_name, package_name=None): """Test if a module can be imported""" try: importlib.import_module(module_name) print(f"โœ… {package_name or module_name}") return True except ImportError as e: print(f"โŒ {package_name or module_name}: {e}") return False def main(): print("๐Ÿงช Testing AI Resume Screener Installation\n") # Core dependencies print("๐Ÿ“ฆ Core Dependencies:") core_deps = [ ("streamlit", "Streamlit"), ("pandas", "Pandas"), ("numpy", "NumPy"), ("plotly", "Plotly"), ] core_success = all(test_import(module, name) for module, name in core_deps) # ML/AI dependencies print("\n๐Ÿค– ML/AI Dependencies:") ml_deps = [ ("sentence_transformers", "Sentence Transformers"), ("transformers", "Transformers"), ("torch", "PyTorch"), ("faiss", "FAISS"), ("rank_bm25", "Rank BM25"), ("nltk", "NLTK"), ] ml_success = all(test_import(module, name) for module, name in ml_deps) # File processing dependencies print("\n๐Ÿ“„ File Processing Dependencies:") file_deps = [ ("pdfplumber", "PDF Plumber"), ("PyPDF2", "PyPDF2"), ("docx", "python-docx"), ("datasets", "Hugging Face Datasets"), ] file_success = all(test_import(module, name) for module, name in file_deps) # Optional dependencies print("\nโšก Optional Dependencies:") optional_deps = [ ("accelerate", "Accelerate"), ("bitsandbytes", "BitsAndBytes"), ] for module, name in optional_deps: test_import(module, name) # Summary print("\n" + "="*50) if core_success and ml_success and file_success: print("๐ŸŽ‰ All required dependencies are installed!") print("โœ… Ready to run AI Resume Screener") # Test basic functionality print("\n๐Ÿ”ง Testing basic functionality...") try: import pandas as pd import numpy as np from sentence_transformers import SentenceTransformer # Test data creation test_df = pd.DataFrame({'test': [1, 2, 3]}) test_array = np.array([1, 2, 3]) print("โœ… Pandas and NumPy working") print("โœ… Installation test completed successfully!") except Exception as e: print(f"โŒ Basic functionality test failed: {e}") else: print("โŒ Some required dependencies are missing") print("๐Ÿ“ Please install missing packages using:") print(" pip install -r requirements.txt") print("\n๐Ÿš€ To run the application:") print(" streamlit run src/streamlit_app.py") if __name__ == "__main__": main()