Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Consiliency_treesitter-chunker /archive /scripts /qa-helpers /final_review.py
| #!/usr/bin/env python3 | |
| """Final review and deployment readiness check.""" | |
| import os | |
| import subprocess | |
| import sys | |
| from datetime import datetime | |
| from pathlib import Path | |
| class FinalReview: | |
| """Performs final review before deployment.""" | |
| def __init__(self): | |
| self.project_root = Path(__file__).parent.parent | |
| self.review_date = datetime.now().strftime("%Y-%m-%d %H:%M:%S") | |
| def check_deployment_readiness(self) -> bool: | |
| """Check if the project is ready for deployment.""" | |
| print("๐ FINAL DEPLOYMENT READINESS CHECK") | |
| print("=" * 45) | |
| print(f"๏ฟฝ๏ฟฝ Review Date: {self.review_date}") | |
| print() | |
| # Run quality checks | |
| print("๐ Running quality assurance...") | |
| try: | |
| result = subprocess.run( | |
| [sys.executable, "scripts/quality_check.py"], | |
| capture_output=True, | |
| text=True, | |
| check=False, | |
| ) | |
| if result.returncode == 0: | |
| print("โ Quality checks passed") | |
| else: | |
| print("โ Quality checks failed") | |
| return False | |
| except Exception as e: | |
| print(f"โ Error running quality checks: {e}") | |
| return False | |
| # Run example validation | |
| print("\n๐ Validating examples...") | |
| try: | |
| result = subprocess.run( | |
| [sys.executable, "scripts/validate_examples.py"], | |
| capture_output=True, | |
| text=True, | |
| check=False, | |
| ) | |
| if result.returncode == 0: | |
| print("โ Examples validated") | |
| else: | |
| print("โ Example validation failed") | |
| return False | |
| except Exception as e: | |
| print(f"โ Error validating examples: {e}") | |
| return False | |
| # Check critical files | |
| print("\n๐ Checking critical files...") | |
| critical_files = [ | |
| "README.md", | |
| "chunker/__init__.py", | |
| "chunker/grammar/manager.py", | |
| "tests/", | |
| "docs/", | |
| ] | |
| for file_path in critical_files: | |
| full_path = self.project_root / file_path | |
| if full_path.exists(): | |
| print(f" โ {file_path}") | |
| else: | |
| print(f" โ {file_path} - MISSING!") | |
| return False | |
| # Check documentation servers | |
| print("\n๐ Checking documentation servers...") | |
| server_scripts = [ | |
| "scripts/serve_mkdocs.py", | |
| "scripts/serve_sphinx.py", | |
| "scripts/serve_all.py", | |
| ] | |
| for script in server_scripts: | |
| script_path = self.project_root / script | |
| if script_path.exists(): | |
| print(f" โ {script}") | |
| else: | |
| print(f" โ {script} - MISSING!") | |
| return False | |
| return True | |
| def generate_deployment_summary(self) -> None: | |
| """Generate deployment summary.""" | |
| print("\n๏ฟฝ๏ฟฝ DEPLOYMENT SUMMARY") | |
| print("=" * 25) | |
| # Project info | |
| print("๐๏ธ Project: Tree-sitter Chunker") | |
| print(f"๐ Location: {self.project_root}") | |
| print(f"๏ฟฝ๏ฟฝ Review Date: {self.review_date}") | |
| # File counts | |
| python_files = len(list(self.project_root.rglob("*.py"))) | |
| markdown_files = len(list(self.project_root.rglob("*.md"))) | |
| test_files = len(list((self.project_root / "tests").rglob("*.py"))) | |
| print(f"๐ Python files: {python_files}") | |
| print(f"๐ Markdown files: {markdown_files}") | |
| print(f"๐งช Test files: {test_files}") | |
| # Archive info | |
| archive_dir = self.project_root / "archive" | |
| if archive_dir.exists(): | |
| archived_files = len(list(archive_dir.rglob("*.md"))) | |
| print(f"๐ฆ Archived files: {archived_files}") | |
| # Scripts info | |
| scripts_dir = self.project_root / "scripts" | |
| if scripts_dir.exists(): | |
| script_count = len(list(scripts_dir.glob("*.py"))) | |
| print(f"๐ง Scripts: {script_count}") | |
| def print_next_steps(self) -> None: | |
| """Print next steps for deployment.""" | |
| print("\n๐ฏ NEXT STEPS") | |
| print("=" * 15) | |
| print("1. ๐ Deploy to production environment") | |
| print("2. ๐ Monitor performance and usage") | |
| print("3. ๐ Address any production issues") | |
| print("4. ๐ Plan future enhancements") | |
| print("5. ๐ Celebrate successful deployment!") | |
| print("\n๐ก DEPLOYMENT COMMANDS:") | |
| print(" # Install from source") | |
| print(" pip install -e .") | |
| print("") | |
| print(" # Run tests") | |
| print(" python scripts/run_all_tests.py") | |
| print("") | |
| print(" # Start documentation servers") | |
| print(" python scripts/serve_all.py") | |
| print("") | |
| print(" # Quality check") | |
| print(" python scripts/quality_check.py") | |
| def main(): | |
| """Main final review function.""" | |
| reviewer = FinalReview() | |
| print("๏ฟฝ๏ฟฝ FINAL REVIEW & DEPLOYMENT READINESS") | |
| print("=" * 50) | |
| if reviewer.check_deployment_readiness(): | |
| print("\n๐ DEPLOYMENT READY!") | |
| reviewer.generate_deployment_summary() | |
| reviewer.print_next_steps() | |
| sys.exit(0) | |
| else: | |
| print("\nโ NOT READY FOR DEPLOYMENT") | |
| print("Please fix the issues above before proceeding.") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() | |
Xet Storage Details
- Size:
- 5.56 kB
- Xet hash:
- a65c1b7c9a9217a85a69bd53143e17f89366c5dc61c97e0d3c7d492b2dd133d2
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.