#!/bin/bash
set -e

# Check if UV is not found
if ! command -v uv &> /dev/null; then
  # If Darwin (macOS), use brew to install UV
  if [[ "$OSTYPE" == "darwin"* ]]; then
    brew install uv
  else
    # If it's Windows, use pip to install UV, else use pip3
    if [[ "$OSTYPE" == "msys" ]]; then
      pip install uv
    else
      pip3 install uv
    fi
  fi
fi

uv venv --allow-existing --no-project
uv pip install \
  "maturin>=1.7,<2" \
  "pillow==11.3.0" \
  "pytest>=8.0" \
  "pytest-xdist>=3.0" \
  "ruff>=0.12,<0.13" \
  "black>=25.1,<26" \
  "isort>=6.0,<7" \
  "flake8>=7.3,<8" \
  "pylint>=4.0,<5" \
  "mypy>=1.18,<2"
