mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-11 15:25:16 -05:00
fix: Install poetry via pipx (Python feature provides pipx, not poetry)
The Python devcontainer feature installs pipx but not poetry by default. Updated to: 1. Add poetry to toolsToInstall in devcontainer.json 2. Use pipx to install poetry in oncreate.sh 3. Ensure PATH includes /usr/local/py-utils/bin where pipx installs tools
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
},
|
||||
"ghcr.io/devcontainers/features/python:1": {
|
||||
"version": "3.13",
|
||||
"installTools": true
|
||||
"installTools": true,
|
||||
"toolsToInstall": "flake8,autopep8,black,mypy,pytest,poetry"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -17,6 +17,21 @@ set -x # Print commands for debugging
|
||||
|
||||
echo "🚀 Starting prebuild setup..."
|
||||
|
||||
# =============================================================================
|
||||
# Install Poetry via pipx (pipx is installed by the Python devcontainer feature)
|
||||
# =============================================================================
|
||||
echo "📦 Installing Poetry..."
|
||||
|
||||
# pipx is installed by the Python feature at /usr/local/py-utils/bin
|
||||
export PATH="/usr/local/py-utils/bin:$PATH"
|
||||
|
||||
if ! command -v poetry &> /dev/null; then
|
||||
pipx install poetry
|
||||
fi
|
||||
|
||||
# Verify poetry is available
|
||||
poetry --version
|
||||
|
||||
# Workspace is autogpt_platform
|
||||
cd /workspaces/AutoGPT/autogpt_platform
|
||||
|
||||
@@ -27,13 +42,6 @@ echo "📦 Installing backend dependencies..."
|
||||
|
||||
cd backend
|
||||
|
||||
# Install Poetry if not present
|
||||
if ! command -v poetry &> /dev/null; then
|
||||
echo "Installing Poetry..."
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Install Python dependencies
|
||||
poetry install --no-interaction --no-ansi
|
||||
|
||||
@@ -51,7 +59,7 @@ echo "📦 Installing frontend dependencies..."
|
||||
|
||||
cd frontend
|
||||
|
||||
# Install pnpm if not present
|
||||
# pnpm should be installed by the Node feature, but ensure it's available
|
||||
if ! command -v pnpm &> /dev/null; then
|
||||
echo "Installing pnpm..."
|
||||
npm install -g pnpm
|
||||
@@ -88,9 +96,6 @@ wait
|
||||
|
||||
echo "✅ Dependency images pulled"
|
||||
|
||||
# NOTE: We intentionally do NOT build backend/frontend images here.
|
||||
# Those need to use the current branch's code, not prebuild's code.
|
||||
|
||||
# =============================================================================
|
||||
# Copy environment files
|
||||
# =============================================================================
|
||||
@@ -122,12 +127,10 @@ echo "✅ PREBUILD COMPLETE"
|
||||
echo "=============================================="
|
||||
echo ""
|
||||
echo "Cached:"
|
||||
echo " ✅ Python packages (poetry)"
|
||||
echo " ✅ Poetry (via pipx)"
|
||||
echo " ✅ Python packages"
|
||||
echo " ✅ Node packages (pnpm)"
|
||||
echo " ✅ Dependency Docker images"
|
||||
echo ""
|
||||
echo "NOT cached (intentionally):"
|
||||
echo " ❌ Backend/Frontend containers (would have stale code)"
|
||||
echo ""
|
||||
echo "The postcreate script will start services."
|
||||
echo ""
|
||||
|
||||
@@ -13,6 +13,9 @@ set -e # Exit on error
|
||||
|
||||
echo "🚀 Setting up your development environment..."
|
||||
|
||||
# Ensure PATH includes pipx binaries (where poetry is installed)
|
||||
export PATH="/usr/local/py-utils/bin:$PATH"
|
||||
|
||||
cd /workspaces/AutoGPT/autogpt_platform
|
||||
|
||||
# =============================================================================
|
||||
@@ -65,9 +68,6 @@ echo "🔄 Running database migrations..."
|
||||
|
||||
cd backend
|
||||
|
||||
# Ensure Poetry is in PATH
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# Run migrations
|
||||
poetry run prisma migrate deploy
|
||||
poetry run prisma generate
|
||||
@@ -127,5 +127,5 @@ echo "🔑 Test Account:"
|
||||
echo " Email: test123@gmail.com"
|
||||
echo " Password: testpassword123"
|
||||
echo ""
|
||||
echo "📚 Full docs: .devcontainer/README.md"
|
||||
echo "📚 Full docs: .devcontainer/platform/README.md"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user