full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Issues with Poetry Installation and Backend Build in GitHub Actions Workflow

Open ErholAB opened this issue 11 months ago • 1 comments

Privileged issue

  • [x] I'm @tiangolo or he asked me directly to create an issue here.

Issue Content

Hello,

I am experiencing issues with my GitHub Actions workflow for my repository ErholAB/full-stack-fastapi-template. The repository is a full-stack, modern web application template using FastAPI, React, SQLModel, PostgreSQL, Docker, and GitHub Actions.

We are using the cloud with the help of Azure Static Web Apps, GitHub, and a full-stack FastAPI template.

Operating System Windows

Operating System Details We are using Azure portal to create a Static Web App and GitHub with a full-stack FastAPI template repository.

Python Version Python 3.8.20

Additional Context I am seeking assistance to:

Resolve the Poetry installation issue in the build and deploy job. Ensure that Oryx recognizes the installed Poetry and can use it for the backend build process. Identify any potential misconfigurations in the workflow file that might be causing these issues. Any guidance or suggestions to fix these issues would be greatly appreciated.

Thank you for your help!

Best regards, Erhol

ErholAB avatar Feb 16 '25 17:02 ErholAB

Hi Erhol 👋,

Thanks for sharing the details!

It looks like the issue is related to the Poetry installation and Oryx not recognizing it during the Azure Static Web Apps deployment via GitHub Actions. I've worked through similar setups, and here’s what you can do to fix it: -Manually install Poetry in your GitHub Actions workflow to ensure it's available before the build step. Install Poetry. curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.local/bin" >> $GITHUB_PATH. -Install dependencies using Poetry before the backend build: Install Python dependencies cd backend poetry install --no-root GitHub Actions workflow is correctly structured name: Azure Static Web Apps CI/CD

on: push: branches: - main

jobs: build_and_deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3

  - name: Set up Python
    uses: actions/setup-python@v4
    with:
      python-version: '3.8'

  - name: Install Poetry
    run: |
      curl -sSL https://install.python-poetry.org | python3 -
      echo "$HOME/.local/bin" >> $GITHUB_PATH

  - name: Install dependencies
    run: |
      cd backend
      poetry install --no-root

  - name: Build frontend
    run: |
      cd frontend
      npm install
      npm run build

  - name: Deploy to Azure Static Web Apps
    uses: Azure/static-web-apps-deploy@v1
    with:
      app_location: "frontend"
      api_location: "backend"
      output_location: "dist"
      azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}

Let me know if you'd like help reviewing your workflow file—happy to assist further!

Best,

Achref

mohamedachrefhacheni avatar Apr 09 '25 11:04 mohamedachrefhacheni

ℹ️ Issue Status: Not Applicable to This Repository

Analysis

This issue describes Poetry installation problems in GitHub Actions, but this YCA Collector repository already uses instead of Poetry.

Current Configuration ✅

Our correctly uses:

  • astral-sh/setup-uv@v6 for package management
  • uv run for all Python commands
  • Modern, fast dependency resolution

For the Original Reporter

The issue appears to be in , not this repository. The solution would be:

  1. Replace Poetry with uv in your workflow:

    - name: Install uv
      uses: astral-sh/setup-uv@v6
      with:
        version: "0.4.15"
        enable-cache: true
    - run: uv run <your-command>
    
  2. Update pyproject.toml to use uv instead of Poetry

  3. Replace Poetry commands with equivalent uv commands

This Repository Status

✅ No action needed - already using uv
✅ CI/CD pipeline working correctly
✅ Modern Python tooling in place

The template this repository is based on has been modernized to use uv for superior performance and reliability.

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

zipaJopa avatar Aug 10 '25 03:08 zipaJopa

Please, use discussions to ask for help. And provide more details (what did you do, what are your configs, what logs do you see).

P.S.: the link you provided doesn't work

YuriiMotov avatar Aug 28 '25 19:08 YuriiMotov