fix: resolve poetry PATH issues with full path fallback
Some checks failed
audit / audit (push) Failing after 6s
ci-cd / build (push) Failing after 4s
ci / build (push) Failing after 2s
autofix / fix (push) Failing after 9s
test / test (push) Successful in 4s
ci-cd / deploy (push) Has been skipped
security-scanning / audit (push) Failing after 7s
Some checks failed
audit / audit (push) Failing after 6s
ci-cd / build (push) Failing after 4s
ci / build (push) Failing after 2s
autofix / fix (push) Failing after 9s
test / test (push) Successful in 4s
ci-cd / deploy (push) Has been skipped
security-scanning / audit (push) Failing after 7s
PROGRESS: Poetry installed via pipx but not in PATH during workflow execution Issue: 'poetry: command not found' despite pipx installation Root cause: PATH not updated in workflow execution context Solution: Use full poetry path as fallback + PATH export Changes: - Add /root/.local/bin to PATH in workflows - Use full poetry path as fallback: /root/.local/share/pipx/venvs/poetry/bin/poetry - Install poetry on gitea-runner server for system availability - Add path detection and fallback logic - Maintain both PATH and full path approaches Updated workflows: - audit.yml: Poetry path resolution + dependency installation - fix.yml: Poetry path resolution + dependency installation + safety - security-scanning.yml: Poetry path resolution + dependency installation + security Expected results: - Poetry found via PATH or full path fallback - Project dependencies installed successfully - Security tools working in project venv - All workflows completing successfully - Complete PEP 668 compliance maintained This should resolve the 'command not found' issue and enable proper poetry execution for dependency management.
This commit is contained in:
@@ -56,13 +56,23 @@ jobs:
|
||||
python3 -m pipx ensurepath
|
||||
fi
|
||||
|
||||
echo "=== POETRY INSTALLATION (via pipx) ==="
|
||||
# Use pipx to install poetry (manages its own venv)
|
||||
echo "=== POETRY SETUP ==="
|
||||
# Add poetry to PATH and install if needed
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
if ! command -v poetry >/dev/null 2>&1; then
|
||||
echo "Installing poetry with pipx..."
|
||||
pipx install poetry
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
else
|
||||
echo "Poetry already available"
|
||||
echo "Poetry already available at $(which poetry)"
|
||||
fi
|
||||
|
||||
# Use full path as fallback
|
||||
POETRY_CMD="/root/.local/share/pipx/venvs/poetry/bin/poetry"
|
||||
if [ -f "$POETRY_CMD" ]; then
|
||||
echo "Using poetry at: $POETRY_CMD"
|
||||
else
|
||||
POETRY_CMD="poetry"
|
||||
fi
|
||||
|
||||
echo "=== PROJECT VIRTUAL ENVIRONMENT ==="
|
||||
@@ -75,9 +85,9 @@ jobs:
|
||||
echo "Pip in venv: $(pip --version)"
|
||||
|
||||
echo "=== PYTHON DEPENDENCIES ==="
|
||||
# Use poetry (installed via pipx) to install project dependencies
|
||||
# Use poetry to install project dependencies
|
||||
echo "Installing project dependencies with poetry..."
|
||||
poetry install
|
||||
$POETRY_CMD install
|
||||
|
||||
echo "✅ Python dependencies installed!"
|
||||
else
|
||||
|
||||
@@ -54,13 +54,23 @@ jobs:
|
||||
python3 -m pipx ensurepath
|
||||
fi
|
||||
|
||||
echo "=== POETRY INSTALLATION (via pipx) ==="
|
||||
# Use pipx to install poetry (manages its own venv)
|
||||
echo "=== POETRY SETUP ==="
|
||||
# Add poetry to PATH and install if needed
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
if ! command -v poetry >/dev/null 2>&1; then
|
||||
echo "Installing poetry with pipx..."
|
||||
pipx install poetry
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
else
|
||||
echo "Poetry already available"
|
||||
echo "Poetry already available at $(which poetry)"
|
||||
fi
|
||||
|
||||
# Use full path as fallback
|
||||
POETRY_CMD="/root/.local/share/pipx/venvs/poetry/bin/poetry"
|
||||
if [ -f "$POETRY_CMD" ]; then
|
||||
echo "Using poetry at: $POETRY_CMD"
|
||||
else
|
||||
POETRY_CMD="poetry"
|
||||
fi
|
||||
|
||||
echo "=== PROJECT VIRTUAL ENVIRONMENT ==="
|
||||
@@ -73,9 +83,9 @@ jobs:
|
||||
echo "Pip in venv: $(pip --version)"
|
||||
|
||||
echo "=== PYTHON DEPENDENCIES ==="
|
||||
# Use poetry (installed via pipx) to install project dependencies
|
||||
# Use poetry to install project dependencies
|
||||
echo "Installing project dependencies with poetry..."
|
||||
poetry install
|
||||
$POETRY_CMD install
|
||||
|
||||
echo "✅ Python dependencies installed!"
|
||||
echo "=== SECURITY FIXES ==="
|
||||
|
||||
@@ -54,13 +54,23 @@ jobs:
|
||||
python3 -m pipx ensurepath
|
||||
fi
|
||||
|
||||
echo "=== POETRY INSTALLATION (via pipx) ==="
|
||||
# Use pipx to install poetry (manages its own venv)
|
||||
echo "=== POETRY SETUP ==="
|
||||
# Add poetry to PATH and install if needed
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
if ! command -v poetry >/dev/null 2>&1; then
|
||||
echo "Installing poetry with pipx..."
|
||||
pipx install poetry
|
||||
export PATH="$PATH:/root/.local/bin"
|
||||
else
|
||||
echo "Poetry already available"
|
||||
echo "Poetry already available at $(which poetry)"
|
||||
fi
|
||||
|
||||
# Use full path as fallback
|
||||
POETRY_CMD="/root/.local/share/pipx/venvs/poetry/bin/poetry"
|
||||
if [ -f "$POETRY_CMD" ]; then
|
||||
echo "Using poetry at: $POETRY_CMD"
|
||||
else
|
||||
POETRY_CMD="poetry"
|
||||
fi
|
||||
|
||||
echo "=== PROJECT VIRTUAL ENVIRONMENT ==="
|
||||
@@ -73,9 +83,9 @@ jobs:
|
||||
echo "Pip in venv: $(pip --version)"
|
||||
|
||||
echo "=== PYTHON DEPENDENCIES ==="
|
||||
# Use poetry (installed via pipx) to install project dependencies
|
||||
# Use poetry to install project dependencies
|
||||
echo "Installing project dependencies with poetry..."
|
||||
poetry install
|
||||
$POETRY_CMD install
|
||||
|
||||
echo "✅ Running security scan..."
|
||||
venv/bin/pip install safety bandit
|
||||
|
||||
Reference in New Issue
Block a user