From b13f4db53604af1e470f7ad779ce2ed823f9394f Mon Sep 17 00:00:00 2001 From: Quentin BEY Date: Thu, 29 Jan 2026 23:21:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(actions)=20migrate=20from=20pip=20?= =?UTF-8?q?to=20uv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrate usage of pip to uv in github actions. How python is setup is also changed. Doing like this, we will just have to upgrade the python version requirement in the pyproject file --- .github/workflows/people.yml | 41 ++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/people.yml b/.github/workflows/people.yml index 4b49cb4..6929416 100644 --- a/.github/workflows/people.yml +++ b/.github/workflows/people.yml @@ -220,19 +220,22 @@ jobs: working-directory: src/backend steps: - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 + uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 with: - python-version: '3.13' - - name: Install development dependencies - run: pip install --user .[dev] + python-version-file: "src/backend/pyproject.toml" + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install the project + run: uv sync --locked --all-extras + - name: Check code formatting with ruff - run: ~/.local/bin/ruff format . --diff + run: uv run ruff format . --diff - name: Lint code with ruff - run: ~/.local/bin/ruff check . + run: uv run ruff check . - name: Lint code with pylint - run: ~/.local/bin/pylint . + run: uv run pylint . test-back: runs-on: ubuntu-latest @@ -278,17 +281,23 @@ jobs: path: "src/backend/core/templates/mail" key: mail-templates-${{ hashFiles('src/mail/mjml') }} fail-on-cache-miss: true - - name: Install Python - uses: actions/setup-python@v5 + + - name: Set up Python + uses: actions/setup-python@v6 with: - python-version: '3.13' - - name: Install development dependencies - run: pip install --user .[dev] + python-version-file: "src/backend/pyproject.toml" + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install the dependencies + run: uv sync --locked --all-extras + - name: Install gettext (required to compile messages) run: | sudo apt-get update sudo apt-get install -y gettext + - name: Generate a MO file from strings extracted from the project - run: python manage.py compilemessages + run: uv run python manage.py compilemessages + - name: Run tests - run: ~/.local/bin/pytest -n 2 + run: uv run pytest -n 2