From 7cdcdee22e6a4f8ab0b0149daa930325b652a659 Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Mon, 8 Sep 2025 08:59:37 -0400 Subject: [PATCH 1/3] code check with uv --- .github/workflows/code-checks.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index a0c2f49bfee60..34b89fc208c7f 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -29,23 +29,23 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v5 - - uses: actions/setup-python@v6 - with: - python-version: "3.11" - - name: Mypy cache - uses: actions/cache@v4 + - name: Install uv and set Python version + uses: astral-sh/setup-uv@v6 with: - path: .mypy_cache - key: mypy-${{ hashFiles('requirements/typing.txt') }} + python-version: "3.11" + # TODO: Avoid activating environment like this + # see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment + activate-environment: true + enable-cache: true - name: Install dependencies env: FREEZE_REQUIREMENTS: 1 timeout-minutes: 20 run: | - pip install -e '.[pytorch-all,fabric-all]' -r requirements/typing.txt - pip list + uv pip install '.[pytorch-all,fabric-all]' -r requirements/typing.txt + uv pip list - name: Check typing run: mypy From 657d72933be42ccd4f9eaff5de350b5d5d3055c8 Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Mon, 8 Sep 2025 09:02:38 -0400 Subject: [PATCH 2/3] prune cache --- .github/workflows/code-checks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 34b89fc208c7f..cf9eab8974d92 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -49,3 +49,6 @@ jobs: - name: Check typing run: mypy + + - name: Minimize uv cache + run: uv cache prune --ci From c619474f3887355bcc1948acfdca33e1311ea5dd Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Mon, 8 Sep 2025 12:35:00 -0400 Subject: [PATCH 3/3] add back mypy cache --- .github/workflows/code-checks.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index cf9eab8974d92..ce4f7e8a501db 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -47,6 +47,12 @@ jobs: uv pip install '.[pytorch-all,fabric-all]' -r requirements/typing.txt uv pip list + - name: mypy cache + uses: actions/cache@v4 + with: + path: .mypy_cache + key: mypy-${{ hashFiles('requirements/typing.txt') }} + - name: Check typing run: mypy