This commit is contained in:
2025-08-20 05:36:39 +02:00
parent bdfcbb9ea1
commit 672c1878da
3 changed files with 24 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# Herolib Web Server Installation Script
# KnowledgeCenter Web Server Installation Script
# This script sets up the necessary environment for the Flask web server.
set -e # Exit on any error
@@ -16,7 +16,7 @@ NC='\033[0m' # No Color
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo -e "${BLUE}🔧 Setting up Herolib Web Server Environment${NC}"
echo -e "${BLUE}🔧 Setting up KnowledgeCenter Web Server Environment${NC}"
echo "=================================================="
# Check if uv is installed
@@ -39,5 +39,20 @@ fi
# Sync dependencies
echo -e "${YELLOW}📦 Installing dependencies with uv...${NC}"
uv sync
if [ -d "$HOME/code/git.ourworld.tf/herocode/herolib_python/herolib" ]; then
echo -e "${GREEN}✅ Found local herolib, installing...${NC}"
uv pip install -e "$HOME/code/git.ourworld.tf/herocode/herolib_python"
else
echo -e "${YELLOW}📦 Local herolib not found, installing from git...${NC}"
uv pip install herolib@git+https://git.ourworld.tf/herocode/herolib_python.git --force-reinstall --no-cache-dir
fi
echo -e "${GREEN}✅ Dependencies installed${NC}"
# Create necessary directories
mkdir -p static/css static/js static/images
mkdir -p templates
mkdir -p md
echo -e "${GREEN}✅ Directory structure verified${NC}"
echo -e "${GREEN}🎉 Installation complete! You can now run start_server.sh${NC}"

View File

@@ -1,20 +1,12 @@
#!/bin/bash
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "Setting up Herolib environment in: $SCRIPT_DIR"
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "❌ uv is not installed. Please install uv first:"
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
echo " or visit: https://docs.astral.sh/uv/getting-started/installation/"
exit 1
fi
echo "✅ uv found: $(uv --version)"
echo "Setting up KnowledgeCenter environment in: $SCRIPT_DIR"
# Create virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
@@ -25,9 +17,6 @@ else
echo "✅ Virtual environment already exists"
fi
export PATH="$SCRIPT_DIR/.venv/bin:$PATH"
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source .venv/bin/activate

View File

@@ -9,10 +9,13 @@ readme = "README.md"
requires-python = ">=3.8"
dependencies = ["peewee"]
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=61.0","wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["."]
include = ["herolib*"]