From 01d377aebbbeb331aeb67cfe900dc0bd98977a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Gr=C4=99dowski?= Date: Thu, 19 Sep 2024 21:20:53 +0200 Subject: [PATCH] fix(ci): use uv for ci deps installing --- .github/actions/setup-ci/action.yml | 32 +++++++++++++---------------- .github/workflows/ci.yml | 4 ++-- src/profiling/README.md | 4 ++-- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/actions/setup-ci/action.yml b/.github/actions/setup-ci/action.yml index 2d68faf..307273c 100644 --- a/.github/actions/setup-ci/action.yml +++ b/.github/actions/setup-ci/action.yml @@ -3,21 +3,17 @@ description: Setup Python and pre-commit for CI runs: using: composite steps: - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - cache: "pip" - cache-dependency-path: | - requirements.lock - requirements-dev.lock - - name: Install dependencies - shell: bash - run: | - python -m pip install --upgrade pip - pip install -r requirements.lock -r requirements-dev.lock - - name: Cache pre-commit - uses: actions/cache@v3 - with: - path: ~/.cache/pre-commit - key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + + - name: Set up Python + shell: bash + run: uv python install + + - name: Install the project + shell: bash + run: uv sync --all-extras --dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d19b29..4fe7530 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: ./.github/actions/setup-ci - name: Pre-commit run: | - SKIP=unittests pre-commit run --all-files --color=always + SKIP=unittests uv run pre-commit run --all-files --color=always unittests: runs-on: ubuntu-latest steps: @@ -29,4 +29,4 @@ jobs: uses: ./.github/actions/setup-ci - name: Test with pytest run: | - python -m pytest . + uv run python -m pytest . -n auto diff --git a/src/profiling/README.md b/src/profiling/README.md index dbe6ae4..1883ba1 100644 --- a/src/profiling/README.md +++ b/src/profiling/README.md @@ -4,8 +4,8 @@ ```bash python3 -m venv .venv -source .venv/bin/activate -pip install pip --upgrade +.venv\Scripts\activate # Windows +# source .venv/bin/activate # Linux/MacOS pip install pyinstrument snakeviz ```