diff --git a/install.sh b/install.sh index 8c07661..c50ff41 100755 --- a/install.sh +++ b/install.sh @@ -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}" \ No newline at end of file diff --git a/env.sh b/pipenv.sh similarity index 53% rename from env.sh rename to pipenv.sh index 1527d1c..e3c4a02 100755 --- a/env.sh +++ b/pipenv.sh @@ -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 - diff --git a/pyproject.toml b/pyproject.toml index 4e19fcf..197d496 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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*"] \ No newline at end of file