|
4 | 4 |
|
5 | 5 | set -e |
6 | 6 |
|
7 | | -echo "🚀 Setting up Python Template environment..." |
| 7 | +# Get the directory where this script is located |
| 8 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
8 | 9 |
|
9 | | -# Check if pixi is installed |
10 | | -if ! command -v pixi &> /dev/null; then |
11 | | - echo "📦 Installing pixi..." |
12 | | - curl -fsSL https://pixi.sh/install.sh | bash |
| 10 | +# Source common setup functions |
| 11 | +source "$SCRIPT_DIR/../setup-common.sh" |
13 | 12 |
|
14 | | - # Add pixi to PATH for current session |
15 | | - export PATH="$HOME/.pixi/bin:$PATH" |
| 13 | +echo "Setting up Python Template environment..." |
16 | 14 |
|
17 | | - # Source bashrc to get pixi in PATH (if bashrc was updated) |
18 | | - [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" |
| 15 | +# Run the full environment setup |
| 16 | +setup_environment |
19 | 17 |
|
20 | | - echo "✅ Pixi installed successfully" |
21 | | -else |
22 | | - echo "✅ Pixi already installed" |
23 | | -fi |
24 | | - |
25 | | -# Ensure pixi is in PATH for this session |
26 | | -export PATH="$HOME/.pixi/bin:$PATH" |
27 | | - |
28 | | -# Install project dependencies |
29 | | -echo "📦 Installing project dependencies..." |
30 | | -pixi install |
31 | | - |
32 | | -# Run pre-commit installation |
33 | | -echo "🔧 Setting up pre-commit hooks..." |
34 | | -pixi run pre-commit install || echo "⚠️ Pre-commit installation skipped (optional)" |
35 | | - |
36 | | -# Set up git merge driver for lockfiles |
37 | | -echo "🔧 Configuring git merge driver..." |
38 | | -pixi run setup-git-merge-driver || true |
39 | | - |
40 | | -echo "✅ Environment setup complete!" |
| 18 | +echo "Environment setup complete!" |
41 | 19 | echo "" |
42 | 20 | echo "Available pixi tasks:" |
43 | 21 | pixi task list |
44 | 22 | echo "" |
45 | | -echo "💡 Common commands:" |
| 23 | +echo "Common commands:" |
46 | 24 | echo " pixi run test - Run tests" |
47 | 25 | echo " pixi run lint - Run linters" |
48 | 26 | echo " pixi run format - Format code" |
|
0 commit comments