From a6ebb056b6cc360ef8230d26dbdfedda6b661671 Mon Sep 17 00:00:00 2001 From: Pavel Epanov <125682660+pavelepanov@users.noreply.github.com> Date: Thu, 24 Oct 2024 00:55:18 +0500 Subject: [PATCH] Change uv manuall installation to setup-uv in CI (#1871) * Change uv manuall installation to setup-uv in CI * Delete pip install uv from all jobs * Change setup-uv action's version from 1 to 3 * Add pre-commit's fixing --------- Co-authored-by: Pavel Epanov --- .github/workflows/docs_deploy.yaml | 4 +- .github/workflows/docs_update-references.yaml | 4 +- .../workflows/docs_update-release-notes.yaml | 5 +- .github/workflows/pr_tests.yaml | 57 ++++++++++++++----- .github/workflows/publish_coverage.yaml | 4 +- 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docs_deploy.yaml b/.github/workflows/docs_deploy.yaml index 4c5e6a43f9..6f7046a6c6 100644 --- a/.github/workflows/docs_deploy.yaml +++ b/.github/workflows/docs_deploy.yaml @@ -19,6 +19,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - uses: actions/setup-python@v5 with: python-version: 3.x @@ -28,7 +31,6 @@ jobs: path: .cache - run: | set -ux - python -m pip install uv uv pip install --system -e .[dev] uv pip uninstall --system email-validator # This is to fix broken link in docs - run: ./scripts/build-docs.sh diff --git a/.github/workflows/docs_update-references.yaml b/.github/workflows/docs_update-references.yaml index e83c97a363..2b2bc2732d 100644 --- a/.github/workflows/docs_update-references.yaml +++ b/.github/workflows/docs_update-references.yaml @@ -25,6 +25,9 @@ jobs: with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.head_ref }} + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -35,7 +38,6 @@ jobs: # should install with `-e` run: | set -ux - python -m pip install uv uv pip install --system -e .[dev] - name: Run build docs run: bash scripts/build-docs.sh diff --git a/.github/workflows/docs_update-release-notes.yaml b/.github/workflows/docs_update-release-notes.yaml index b9344fa1cc..9192d23e98 100644 --- a/.github/workflows/docs_update-release-notes.yaml +++ b/.github/workflows/docs_update-release-notes.yaml @@ -20,7 +20,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Configure Git user run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -39,7 +41,6 @@ jobs: - name: Install dependencies run: | - python -m pip install uv uv pip install --system requests - name: Run update_releases.py script diff --git a/.github/workflows/pr_tests.yaml b/.github/workflows/pr_tests.yaml index 5e7259a6fb..e9282d496c 100644 --- a/.github/workflows/pr_tests.yaml +++ b/.github/workflows/pr_tests.yaml @@ -61,6 +61,9 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -73,7 +76,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - name: Install Pydantic v1 if: matrix.pydantic-version == 'pydantic-v1' @@ -102,6 +104,9 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -109,7 +114,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - name: Test run: > @@ -121,6 +125,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -128,7 +135,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - name: Test run: > @@ -140,6 +146,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -147,7 +156,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[kafka,test-core,cli] - name: Test run: > @@ -179,6 +187,9 @@ jobs: ALLOW_PLAINTEXT_LISTENER: "true" steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -186,7 +197,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - run: mkdir coverage - name: Test @@ -209,6 +219,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -216,7 +229,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[confluent,test-core,cli] - name: Test run: > @@ -248,6 +260,9 @@ jobs: ALLOW_PLAINTEXT_LISTENER: "true" steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -255,7 +270,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - run: mkdir coverage - name: Test @@ -278,6 +292,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -285,7 +302,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[rabbit,test-core,cli] - name: Test run: > @@ -306,6 +322,9 @@ jobs: - 5672:5672 steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -313,7 +332,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - run: mkdir coverage - name: Test @@ -336,6 +354,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -343,7 +364,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[nats,test-core,cli] - name: Test run: > @@ -364,6 +384,9 @@ jobs: - 4222:4222 steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -371,7 +394,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - run: mkdir coverage - name: Test @@ -394,6 +416,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -401,7 +426,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[redis,test-core,cli] - name: Test run: > @@ -422,6 +446,9 @@ jobs: - 6379:6379 steps: - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - name: Set up Python uses: actions/setup-python@v5 with: @@ -429,7 +456,6 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - python -m pip install uv uv pip install --system .[optionals,testing] - run: mkdir coverage - name: Test @@ -460,7 +486,9 @@ jobs: steps: - uses: actions/checkout@v4 - + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - uses: actions/setup-python@v5 with: python-version: "3.8" @@ -473,7 +501,6 @@ jobs: merge-multiple: true - run: | - python -m pip install uv uv pip install --system coverage[toml] - run: ls -la coverage diff --git a/.github/workflows/publish_coverage.yaml b/.github/workflows/publish_coverage.yaml index 766d5c9c94..755b0cf9ce 100644 --- a/.github/workflows/publish_coverage.yaml +++ b/.github/workflows/publish_coverage.yaml @@ -16,9 +16,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.9" + - uses: astral-sh/setup-uv@v3 + with: + version: "latest" - run: | - python -m pip install uv uv pip install --system smokeshow - uses: dawidd6/action-download-artifact@v6 # nosemgrep