-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathsetup-dev.sh
More file actions
executable file
·57 lines (44 loc) · 1.79 KB
/
Copy pathsetup-dev.sh
File metadata and controls
executable file
·57 lines (44 loc) · 1.79 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
52
53
54
55
56
57
#!/bin/bash
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
#
# SPDX-License-Identifier: Apache-2.0
# Setup local development environment for Haystack docs testing
# This script generates requirements.txt and installs dependencies
set -e # Exit on any error
echo "🚀 Setting up local development environment for Haystack docs testing..."
# Check if we're in the right directory
if [ ! -f "scripts/generate_requirements.py" ]; then
echo "❌ Error: Please run this script from the docs-website directory in the haystack repository"
exit 1
fi
# Check if Python is available
if ! command -v python &> /dev/null; then
echo "❌ Error: Python is not installed or not in PATH"
exit 1
fi
echo "⬆️ Upgrading pip..."
python -m pip install --upgrade pip
# Check if base dependencies are installed
echo "📦 Checking base dependencies..."
python -c "import requests, toml" 2>/dev/null || {
echo "⚠️ Installing base dependencies (requests, toml)..."
pip install requests toml --uploaded-prior-to=P1D
}
# Get Haystack version (default to main)
VERSION=${1:-main}
echo "🔍 Generating requirements.txt for Haystack version: $VERSION"
# Generate requirements.txt
python scripts/generate_requirements.py --version "$VERSION"
# Check if requirements.txt was generated
if [ ! -f "requirements.txt" ]; then
echo "❌ Error: requirements.txt was not generated"
exit 1
fi
echo "📋 Generated requirements.txt with $(wc -l < requirements.txt) dependencies"
# Install dependencies
echo "⚙️ Installing dependencies..."
pip install -r requirements.txt --uploaded-prior-to=P1D
echo "✅ Setup complete! You can now run:"
echo " python scripts/test_python_snippets.py --verbose"
echo ""
echo "📝 Note: requirements.txt is auto-generated and should not be committed to git"