From 0c6c862dd2475f074a229270f9fe40ab9a0ea002 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Thu, 1 May 2025 01:16:07 +0200 Subject: [PATCH 1/4] ci: simplify ci by using additional options in astral-sh/setup-uv --- .github/workflows/code-check.yml | 34 ++++++++++---------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index c1d65a6..4e4df19 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -1,5 +1,7 @@ name: Linters and tests on: [pull_request] +env: + UV_SYSTEM_PYTHON: 1 jobs: lint: @@ -7,21 +9,13 @@ jobs: name: Lint code steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.12' - uses: astral-sh/setup-uv@v5 with: - version: "0.6.13" - - uses: actions/cache@v4 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-uv + version: "0.7.2" + use-cache: true - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: | - uv pip install --system .[dev] + run: uv pip install --all-extras - name: Run linters run: make lint test: @@ -36,26 +30,18 @@ jobs: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 with: - version: "0.5.31" - - name: Set up Python - uses: actions/setup-python@v5 - with: + version: "0.7.2" + use-cache: true python-version: ${{ matrix.python-version }} - - uses: actions/cache@v4 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-uv - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: | - uv pip install --system .[dev] + run: uv pip install --all-extras - name: Install Pydantic v1 if: matrix.pydantic-version == 'pydantic-v1' - run: uv pip install --system "pydantic>=1.10.0,<2.0.0" + run: uv pip install "pydantic>=1.10.0,<2.0.0" - name: Install Pydantic v2 if: matrix.pydantic-version == 'pydantic-v2' - run: uv pip install --system --prerelease=disallow "pydantic>=2.0.0,<3.0.0" + run: uv pip install --prerelease=disallow "pydantic>=2.0.0,<3.0.0" - run: mkdir coverage - name: Test run: make test From bbaf6136d773fd1ebe8ffd9401841deea038b127 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Thu, 1 May 2025 01:17:31 +0200 Subject: [PATCH 2/4] ci: fix cache --- .github/workflows/code-check.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index 4e4df19..d0f1cca 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -9,12 +9,13 @@ jobs: name: Lint code steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 + - id: setup-uv + uses: astral-sh/setup-uv@v5 with: version: "0.7.2" use-cache: true - name: Install Dependencies - if: steps.cache.outputs.cache-hit != 'true' + if: steps.setup-uv.outputs.cache-hit != 'true' run: uv pip install --all-extras - name: Run linters run: make lint @@ -28,13 +29,14 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 + - id: setup-uv + uses: astral-sh/setup-uv@v5 with: version: "0.7.2" use-cache: true python-version: ${{ matrix.python-version }} - name: Install Dependencies - if: steps.cache.outputs.cache-hit != 'true' + if: steps.setup-uv.outputs.cache-hit != 'true' run: uv pip install --all-extras - name: Install Pydantic v1 if: matrix.pydantic-version == 'pydantic-v1' From 10f184b3d420f95d5ca066a3b7f9107ae26691a5 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Thu, 1 May 2025 01:21:17 +0200 Subject: [PATCH 3/4] ci: fix package installation --- .github/workflows/code-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index d0f1cca..cae3e34 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -16,7 +16,7 @@ jobs: use-cache: true - name: Install Dependencies if: steps.setup-uv.outputs.cache-hit != 'true' - run: uv pip install --all-extras + run: uv sync --all-extras - name: Run linters run: make lint test: @@ -37,7 +37,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Dependencies if: steps.setup-uv.outputs.cache-hit != 'true' - run: uv pip install --all-extras + run: uv sync --all-extras - name: Install Pydantic v1 if: matrix.pydantic-version == 'pydantic-v1' run: uv pip install "pydantic>=1.10.0,<2.0.0" From 809e617ceae8d720030f2c99df9d72062a1e3e8e Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Thu, 1 May 2025 01:22:24 +0200 Subject: [PATCH 4/4] ci: disable system python installtion --- .github/workflows/code-check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index cae3e34..112f60c 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -1,7 +1,5 @@ name: Linters and tests on: [pull_request] -env: - UV_SYSTEM_PYTHON: 1 jobs: lint: