Buckets:

download
raw
5.56 kB
#!/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.