-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_force.sh
More file actions
executable file
·51 lines (43 loc) · 1.57 KB
/
Copy pathdeploy_force.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Force deployment script - Aggressively removes PyMuPDF
set -e
echo "🚀 Starting FORCE deployment (PyMuPDF-free)..."
# Remove any existing PyMuPDF installations
echo "🧹 Removing any existing PyMuPDF installations..."
pip uninstall -y PyMuPDF pymupdf4llm || true
# Install only our deployment requirements
echo "📦 Installing deployment requirements..."
pip install -r requirements-deploy.txt
# Double-check PyMuPDF is not installed
echo "🔍 Verifying PyMuPDF is not installed..."
if python -c "import fitz" 2>/dev/null; then
echo "❌ PyMuPDF is still installed! Removing it..."
pip uninstall -y PyMuPDF pymupdf4llm
echo "✅ PyMuPDF removed"
else
echo "✅ PyMuPDF is not installed"
fi
# Verify PDF processing works with alternatives
echo "🔍 Testing PDF processing with alternatives..."
python3 -c "
try:
from backend.utils.pdf_processor import pdf_processor
print(f'✅ PDF processor initialized with: {pdf_processor.primary_lib}')
print(f'📚 Available libraries: {pdf_processor.available_libraries}')
if 'pymupdf' in pdf_processor.available_libraries and pdf_processor.available_libraries['pymupdf']:
print('❌ ERROR: PyMuPDF is still available!')
exit(1)
else:
print('✅ PyMuPDF is not available - using alternatives')
except Exception as e:
print(f'❌ PDF processor test failed: {e}')
exit(1)
"
echo "🎉 Force deployment completed successfully!"
echo "🚀 Starting application..."
# Start the application
if [ -f "backend/app.py" ]; then
cd backend && python app.py
else
python app.py
fi