Skip to content

Commit

Permalink
Fixes Poetry setup in Dev Container
Browse files Browse the repository at this point in the history
* Adds Poetry to PATH variable
* Checks if Poetry was installed successfully
* Gives executable permission to `setup.sh` before executing it
  • Loading branch information
cr2007 committed Oct 28, 2024
1 parent a4569b5 commit 280cd3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
},

// Setup Poetry and install dependencies
"postStartCommand": "bash ./.devcontainer/setup.sh"
"postStartCommand": "chmod +x ./.devcontainer/setup.sh && bash ./.devcontainer/setup.sh"
}
12 changes: 9 additions & 3 deletions .devcontainer/setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
# Install Poetry
curl -sSL https://install.python-poetry.org | python - -y

# Update Poetry configuration
poetry config virtualenv.create false
# Add Poetry to PATH (important in container environments)
export PATH="/home/vscode/.local/bin:$PATH"

# Check if Poetry was installed
if ! poetry --version; then
echo "Poetry installation failed"
exit 1
fi

# Install dependencies
poetry install --no-root
poetry install

0 comments on commit 280cd3e

Please sign in to comment.