From ec11eed7c9f8e91b04d3ca431c5d202c41078dd2 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:25:21 +0545 Subject: [PATCH 01/18] Upgrade GitHub Actions to use uv instead of pip - Replace actions/setup-python with astral-sh/setup-uv in all workflows - Update composite actions to use uv commands (uv pip, uv build, etc.) - Add uv caching with enable-cache: true and uv cache prune --ci - Add UV_TORCH_BACKEND: cpu for PyTorch installations - Update cache action to only handle conda caching --- .github/actions/cache/action.yml | 15 +------------ .github/actions/pip-list/action.yml | 4 ++-- .github/actions/pkg-create/action.yml | 2 +- .github/actions/pkg-install/action.yml | 16 ++++++------- .github/workflows/check-docs.yml | 16 ++++++++----- .github/workflows/check-package.yml | 23 ++++++++++++------- .github/workflows/check-precommit.yml | 10 ++++++--- .github/workflows/check-schema.yml | 20 ++++++++++++----- .github/workflows/check-typing.yml | 14 ++++++++---- .github/workflows/ci-cli.yml | 12 ++++++---- .github/workflows/ci-scripts.yml | 31 ++++++++++++++++---------- .github/workflows/ci-testing.yml | 17 +++++++++----- .github/workflows/cleanup-caches.yml | 11 ++++++++- .github/workflows/deploy-docs.yml | 25 +++++++++------------ .github/workflows/release-pypi.yml | 10 ++++++--- 15 files changed, 133 insertions(+), 93 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 0a399fd5..ae2327ee 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -1,5 +1,5 @@ name: Complex caching -description: some more complex caching - pip & conda +description: some more complex caching - conda inputs: python-version: @@ -21,19 +21,6 @@ inputs: runs: using: "composite" steps: - - name: Determine caches - id: cache_dirs - run: echo "pip_dir=$(pip cache dir)" >> $GITHUB_OUTPUT - shell: bash - - - name: Cache πŸ’½ pip - uses: actions/cache@v3 - with: - path: ${{ steps.cache_dirs.outputs.pip_dir }} - key: py${{ inputs.python-version }}-pip-${{ inputs.offset }}-${{ hashFiles('requirements.txt') }} - restore-keys: py${{ inputs.python-version }}-pip-${{ inputs.offset }}- - enableCrossOsArchive: true - - name: Cache πŸ’½ conda uses: actions/cache@v3 if: runner.os == 'Linux' diff --git a/.github/actions/pip-list/action.yml b/.github/actions/pip-list/action.yml index 156fde4f..e567b3d7 100644 --- a/.github/actions/pip-list/action.yml +++ b/.github/actions/pip-list/action.yml @@ -20,9 +20,9 @@ runs: echo 'pip list' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY - pip list >> $GITHUB_STEP_SUMMARY + uv pip list >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY echo '' >> $GITHUB_STEP_SUMMARY - pip list # also print to stdout + uv pip list # also print to stdout shell: bash diff --git a/.github/actions/pkg-create/action.yml b/.github/actions/pkg-create/action.yml index 0f31910f..de6fd5b7 100644 --- a/.github/actions/pkg-create/action.yml +++ b/.github/actions/pkg-create/action.yml @@ -6,7 +6,7 @@ runs: steps: - name: Create package πŸ“¦ # python setup.py clean - run: python -m build --verbose + run: uv build --verbose shell: bash - name: Check package πŸ“¦ diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index c1bbf361..45ee353f 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -32,10 +32,10 @@ runs: working-directory: ${{ inputs.pkg-folder }} run: | ls -lh - pip -V + uv --version echo "PKG_WHEEL=$(ls *.whl | head -n1)" >> $GITHUB_ENV echo "PKG_SOURCE=$(ls *.tar.gz | head -n1)" >> $GITHUB_ENV - pip list + uv pip list shell: bash - name: Install package (archive) @@ -43,9 +43,9 @@ runs: working-directory: pypi/ run: | set -ex - pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \ + uv pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \ --force-reinstall ${{ inputs.pip-flags }} - pip list + uv pip list shell: bash - name: Install package (wheel) @@ -53,9 +53,9 @@ runs: working-directory: ${{ inputs.pkg-folder }} run: | set -ex - pip install '${{ env.PKG_WHEEL }}${{ inputs.pkg-extras }}' \ + uv pip install '${{ env.PKG_WHEEL }}${{ inputs.pkg-extras }}' \ --force-reinstall ${{ inputs.pip-flags }} - pip list + uv pip list shell: bash - name: package check / import @@ -73,6 +73,6 @@ runs: - name: Uninstall all # TODO: reset env / consider add as conda run: | - pip freeze > _reqs.txt - pip uninstall -y -r _reqs.txt + uv pip freeze > _reqs.txt + uv pip uninstall -y -r _reqs.txt shell: bash diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index 91e18da6..af932265 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -55,6 +55,7 @@ defaults: env: # just use CPU version since running on CPU machine TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" + UV_TORCH_BACKEND: cpu # default 0 means to keep for the maximum time KEEP_DAYS: 0 @@ -72,11 +73,11 @@ jobs: with: submodules: recursive - - name: Set up Python 🐍 ${{ inputs.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ inputs.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ inputs.python-version }} - cache: "pip" + enable-cache: true - name: Install pandoc & texlive if: ${{ inputs.install-tex == 'true' }} @@ -92,9 +93,12 @@ jobs: - name: Install dependencies timeout-minutes: 20 run: | - pip --version - pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL} - pip list + uv --version + uv pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL} + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: Pull reusable πŸ€– actions️ if: ${{ inputs.actions-ref != '' }} diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 4b910138..37169b39 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -80,10 +80,11 @@ jobs: with: fetch-depth: 0 # checkout entire history for all branches (required when using scm-based versioning) submodules: recursive - - name: Set up Python 🐍 - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version || '3.x' }} + enable-cache: true - name: Pull reusable πŸ€– actions️ uses: actions/checkout@v5 @@ -93,8 +94,10 @@ jobs: repository: Lightning-AI/utilities - name: Prepare build env. run: | - pip install -q -r ./.cicd/requirements/gha-package.txt - pip list + uv pip install -q -r ./.cicd/requirements/gha-package.txt + uv pip list + - name: Minimize uv cache + run: uv cache prune --ci - name: Create package πŸ“¦ uses: ./.cicd/.github/actions/pkg-create - name: Upload πŸ“€ packages @@ -116,8 +119,11 @@ jobs: repository: Lightning-AI/utilities - name: Prepare build env. run: | - pip install -q -r ./.cicd/requirements/gha-package.txt - pip list + uv pip install -q -r ./.cicd/requirements/gha-package.txt + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: Download πŸ“₯ uses: actions/download-artifact@v6 @@ -148,10 +154,11 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive - - name: Set up Python 🐍 ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version || '3.x' }} + enable-cache: true - name: Pull reusable πŸ€– actions️ uses: actions/checkout@v5 diff --git a/.github/workflows/check-precommit.yml b/.github/workflows/check-precommit.yml index c4115f21..c433058b 100644 --- a/.github/workflows/check-precommit.yml +++ b/.github/workflows/check-precommit.yml @@ -38,10 +38,11 @@ jobs: submodules: recursive token: ${{ secrets.github-token || github.token }} - - name: Set up Python 🐍 - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 + uses: astral-sh/setup-uv@v7 with: python-version: ${{ inputs.python-version }} + enable-cache: true - name: Cache πŸ’½ pre-commit if: ${{ inputs.use-cache == true }} @@ -53,9 +54,12 @@ jobs: - name: Run pre-commit πŸ€– id: precommit run: | - pip install -q pre-commit + uv pip install -q pre-commit pre-commit run --all-files + - name: Minimize uv cache + run: uv cache prune --ci + - name: Fixing Pull Request ↩️ if: always() && inputs.push-fixes == true && steps.precommit.outcome == 'failure' uses: actions-js/push@v1.5 diff --git a/.github/workflows/check-schema.yml b/.github/workflows/check-schema.yml index d950468b..9e55d8e5 100644 --- a/.github/workflows/check-schema.yml +++ b/.github/workflows/check-schema.yml @@ -31,10 +31,11 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive - - name: Set up Python - uses: actions/setup-python@v6 + - name: Set up uv and Python + uses: astral-sh/setup-uv@v7 with: python-version: "3.10" + enable-cache: true # if actions version is given install defined versions - name: "[optional] Pull reusable πŸ€– actions" @@ -48,15 +49,22 @@ jobs: if: inputs.actions-ref != '' timeout-minutes: 5 run: | - pip install -r ./.cicd/requirements/gha-schema.txt - pip list | grep "check-jsonschema" + uv pip install -r ./.cicd/requirements/gha-schema.txt + uv pip list | grep "check-jsonschema" + + - name: Minimize uv cache + run: uv cache prune --ci + # otherwise fall back to using the latest - name: "[default] Install recommended dependencies" if: inputs.actions-ref == '' timeout-minutes: 5 run: | - pip install -q check-jsonschema - pip list | grep "check-jsonschema" + uv pip install -q check-jsonschema + uv pip list | grep "check-jsonschema" + + - name: Minimize uv cache + run: uv cache prune --ci - name: Scan repo id: folders diff --git a/.github/workflows/check-typing.yml b/.github/workflows/check-typing.yml index ecd4d211..e330a6f2 100644 --- a/.github/workflows/check-typing.yml +++ b/.github/workflows/check-typing.yml @@ -31,24 +31,30 @@ defaults: jobs: mypy: runs-on: ubuntu-24.04 + env: + UV_TORCH_BACKEND: cpu steps: - name: Checkout πŸ›ŽοΈ uses: actions/checkout@v5 with: submodules: recursive - - name: Set up Python 🐍 ${{ inputs.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ inputs.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ inputs.python-version }} + enable-cache: true - name: Install dependencies timeout-minutes: 20 run: | # don't use --upgrade to respect the version installed via setup.py - pip install -e '.[${{ inputs.extra-typing }}]' mypy \ + uv pip install -e '.[${{ inputs.extra-typing }}]' mypy \ --extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html - pip list + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: Pull reusable πŸ€– actions️ if: ${{ inputs.actions-ref != '' }} diff --git a/.github/workflows/ci-cli.yml b/.github/workflows/ci-cli.yml index 538bec54..ac58e58f 100644 --- a/.github/workflows/ci-cli.yml +++ b/.github/workflows/ci-cli.yml @@ -22,15 +22,19 @@ jobs: steps: - name: Checkout πŸ›Ž uses: actions/checkout@v5 - - name: Set up Python 🐍 ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} + enable-cache: true - name: install package run: | - pip install -e '.[cli]' - pip list + uv pip install -e '.[cli]' + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: run CLI working-directory: ./requirements diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index 2966b322..20e6b901 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -22,18 +22,21 @@ jobs: steps: - name: Checkout πŸ›Ž uses: actions/checkout@v5 - - name: Set up Python 🐍 ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} - cache: "pip" + enable-cache: true - name: Install dependencies timeout-minutes: 5 run: | - pip install -r requirements/_tests.txt - pip --version - pip list + uv pip install -r requirements/_tests.txt + uv --version + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: test Scripts working-directory: ./scripts @@ -44,21 +47,25 @@ jobs: timeout-minutes: 20 env: TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" + UV_TORCH_BACKEND: cpu steps: - name: Checkout πŸ›Ž uses: actions/checkout@v5 - - name: Set up Python 🐍 ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: "3.10" - cache: "pip" + enable-cache: true - name: Install dependencies timeout-minutes: 20 run: | set -e - pip install -e ".[cli]" -U -r requirements/_tests.txt -f $TORCH_URL - pip --version - pip list + uv pip install -e ".[cli]" -U -r requirements/_tests.txt -f $TORCH_URL + uv --version + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: Run standalone script run: bash ./scripts/run_standalone_tests.sh "tests" diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 46b139a2..1474a1e1 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -24,21 +24,23 @@ jobs: timeout-minutes: 35 env: TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" + UV_TORCH_BACKEND: cpu steps: - name: Checkout πŸ›Ž uses: actions/checkout@v5 with: submodules: recursive - - name: Set up Python 🐍 ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} + enable-cache: true - name: Set oldest dependencies if: matrix.requires == 'oldest' timeout-minutes: 20 run: | - pip install -e '.[cli]' + uv pip install -e '.[cli]' python -m lightning_utilities.cli requirements set-oldest - name: Complex πŸ’½ caching @@ -50,9 +52,12 @@ jobs: timeout-minutes: 20 run: | set -e - pip install -e ".[cli]" -U -r requirements/_tests.txt -f $TORCH_URL - pip --version - pip list + uv pip install -e ".[cli]" -U -r requirements/_tests.txt -f $TORCH_URL + uv --version + uv pip list + + - name: Minimize uv cache + run: uv cache prune --ci - name: Print πŸ–¨οΈ dependencies uses: ./.github/actions/pip-list diff --git a/.github/workflows/cleanup-caches.yml b/.github/workflows/cleanup-caches.yml index b7be9101..1f2bc870 100644 --- a/.github/workflows/cleanup-caches.yml +++ b/.github/workflows/cleanup-caches.yml @@ -41,6 +41,12 @@ jobs: - name: Checkout Code uses: actions/checkout@v5 + - name: Set up uv and Python + uses: astral-sh/setup-uv@v7 + with: + python-version: "3.10" + enable-cache: true + - name: Pull reusable πŸ€– actions️ uses: actions/checkout@v5 with: @@ -49,7 +55,10 @@ jobs: repository: Lightning-AI/utilities - name: install requirements timeout-minutes: 20 - run: pip install -U -r ./.cicd/.github/scripts/find-unused-caches.txt + run: uv pip install -U -r ./.cicd/.github/scripts/find-unused-caches.txt + + - name: Minimize uv cache + run: uv cache prune --ci - name: List and Filer πŸ” caches run: | diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 25ce1210..7e897a7c 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest env: TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" + UV_TORCH_BACKEND: cpu steps: - name: Checkout πŸ›ŽοΈ uses: actions/checkout@v5 @@ -22,20 +23,11 @@ jobs: with: persist-credentials: false submodules: recursive - - name: Set up Python 🐍 - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 + uses: astral-sh/setup-uv@v7 with: python-version: "3.10" - cache: "pip" - - # Note: This uses an internal pip API and may not always work - # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow - - name: Cache πŸ’½ pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: pip-${{ hashFiles('requirements/*.txt') }} - restore-keys: pip- + enable-cache: true #- name: Install texlive # timeout-minutes: 20 @@ -48,11 +40,14 @@ jobs: - name: Install dependencies timeout-minutes: 20 run: | - pip --version - pip install -e . -U -q -r requirements/_docs.txt -f ${TORCH_URL} - pip list + uv --version + uv pip install -e . -U -q -r requirements/_docs.txt -f ${TORCH_URL} + uv pip list shell: bash + - name: Minimize uv cache + run: uv cache prune --ci + - name: Make Documentation working-directory: ./docs run: make html --jobs 2 diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index 4d6866d0..da2157fc 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -22,12 +22,16 @@ jobs: steps: - name: Checkout πŸ›ŽοΈ uses: actions/checkout@v5 - - name: Set up Python 🐍 - uses: actions/setup-python@v6 + - name: Set up uv and Python 🐍 + uses: astral-sh/setup-uv@v7 with: python-version: "3.10" + enable-cache: true - name: Prepare build env. - run: pip install -r ./requirements/gha-package.txt + run: uv pip install -r ./requirements/gha-package.txt + + - name: Minimize uv cache + run: uv cache prune --ci - name: Create πŸ“¦ package uses: ./.github/actions/pkg-create - name: Upload πŸ“€ packages From 127efbd86c5e90190269f5a4b28eccc3aba49bea Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:35:02 +0545 Subject: [PATCH 02/18] Add activate-environment: true to all astral-sh/setup-uv actions Explicitly set activate-environment to true for clarity and consistency. --- .github/workflows/check-docs.yml | 1 + .github/workflows/check-package.yml | 2 ++ .github/workflows/check-precommit.yml | 1 + .github/workflows/check-schema.yml | 1 + .github/workflows/check-typing.yml | 1 + .github/workflows/ci-cli.yml | 1 + .github/workflows/ci-scripts.yml | 2 ++ .github/workflows/ci-testing.yml | 1 + .github/workflows/cleanup-caches.yml | 1 + .github/workflows/deploy-docs.yml | 1 + .github/workflows/release-pypi.yml | 1 + 11 files changed, 13 insertions(+) diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index af932265..d48d7938 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -76,6 +76,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ inputs.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ inputs.python-version }} enable-cache: true diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 37169b39..eb269497 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -83,6 +83,7 @@ jobs: - name: Set up uv and Python 🐍 uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ matrix.python-version || '3.x' }} enable-cache: true @@ -157,6 +158,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ matrix.python-version || '3.x' }} enable-cache: true diff --git a/.github/workflows/check-precommit.yml b/.github/workflows/check-precommit.yml index c433058b..a9bb02d2 100644 --- a/.github/workflows/check-precommit.yml +++ b/.github/workflows/check-precommit.yml @@ -41,6 +41,7 @@ jobs: - name: Set up uv and Python 🐍 uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ inputs.python-version }} enable-cache: true diff --git a/.github/workflows/check-schema.yml b/.github/workflows/check-schema.yml index 9e55d8e5..16f106dd 100644 --- a/.github/workflows/check-schema.yml +++ b/.github/workflows/check-schema.yml @@ -34,6 +34,7 @@ jobs: - name: Set up uv and Python uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: "3.10" enable-cache: true diff --git a/.github/workflows/check-typing.yml b/.github/workflows/check-typing.yml index e330a6f2..69487e90 100644 --- a/.github/workflows/check-typing.yml +++ b/.github/workflows/check-typing.yml @@ -42,6 +42,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ inputs.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ inputs.python-version }} enable-cache: true diff --git a/.github/workflows/ci-cli.yml b/.github/workflows/ci-cli.yml index ac58e58f..1a33867c 100644 --- a/.github/workflows/ci-cli.yml +++ b/.github/workflows/ci-cli.yml @@ -25,6 +25,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ matrix.python-version }} enable-cache: true diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index 20e6b901..c64ca5f2 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -25,6 +25,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ matrix.python-version }} enable-cache: true @@ -54,6 +55,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: "3.10" enable-cache: true - name: Install dependencies diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 1474a1e1..3a7648c3 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -33,6 +33,7 @@ jobs: - name: Set up uv and Python 🐍 ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: ${{ matrix.python-version }} enable-cache: true diff --git a/.github/workflows/cleanup-caches.yml b/.github/workflows/cleanup-caches.yml index 1f2bc870..0d70a40f 100644 --- a/.github/workflows/cleanup-caches.yml +++ b/.github/workflows/cleanup-caches.yml @@ -44,6 +44,7 @@ jobs: - name: Set up uv and Python uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: "3.10" enable-cache: true diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 7e897a7c..723c8f16 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -26,6 +26,7 @@ jobs: - name: Set up uv and Python 🐍 uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: "3.10" enable-cache: true diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index da2157fc..553ae09b 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -25,6 +25,7 @@ jobs: - name: Set up uv and Python 🐍 uses: astral-sh/setup-uv@v7 with: + activate-environment: true python-version: "3.10" enable-cache: true - name: Prepare build env. From 81eba9497281a9fcd563ec35f8e3f3e6ce344de5 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:37:42 +0545 Subject: [PATCH 03/18] Fix merge-artifacts job: add setup-uv before using uv commands --- .github/workflows/check-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index eb269497..ee1ddf47 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -118,6 +118,12 @@ jobs: ref: ${{ inputs.actions-ref }} path: .cicd repository: Lightning-AI/utilities + - name: Set up uv and Python + uses: astral-sh/setup-uv@v7 + with: + activate-environment: true + python-version: "3.10" + enable-cache: true - name: Prepare build env. run: | uv pip install -q -r ./.cicd/requirements/gha-package.txt From 25f3738795a832e287d47583a281c9d2b14165cf Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:38:40 +0545 Subject: [PATCH 04/18] Fix mypy: install types-requests for requests library stubs --- .github/workflows/check-typing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-typing.yml b/.github/workflows/check-typing.yml index 69487e90..ec8fe3df 100644 --- a/.github/workflows/check-typing.yml +++ b/.github/workflows/check-typing.yml @@ -50,7 +50,7 @@ jobs: timeout-minutes: 20 run: | # don't use --upgrade to respect the version installed via setup.py - uv pip install -e '.[${{ inputs.extra-typing }}]' mypy \ + uv pip install -e '.[${{ inputs.extra-typing }}]' mypy types-requests \ --extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html uv pip list From 6a9b2e828d99253ed4b945be0c4fe53b8fdfbd8c Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:40:03 +0545 Subject: [PATCH 05/18] Fix Windows tests: use uv run for pytest to ensure virtual env is used --- .github/workflows/ci-scripts.yml | 2 +- .github/workflows/ci-testing.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index c64ca5f2..02cf0aef 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -41,7 +41,7 @@ jobs: - name: test Scripts working-directory: ./scripts - run: pytest . -v + run: uv run pytest . -v standalone-run: runs-on: "ubuntu-22.04" diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 3a7648c3..8f930b9d 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -65,7 +65,7 @@ jobs: - name: Unittests working-directory: ./tests - run: python -m pytest unittests --cov=lightning_utilities --durations=50 --timeout=120 + run: uv run python -m pytest unittests --cov=lightning_utilities --durations=50 --timeout=120 - name: Statistics working-directory: ./tests @@ -86,7 +86,7 @@ jobs: - name: test CI scripts working-directory: ./tests - run: python -m pytest scripts --durations=50 --timeout=120 + run: uv run python -m pytest scripts --durations=50 --timeout=120 testing-guardian: runs-on: ubuntu-latest From f776b9e6e712e381ef4ad39bf5bee306abee0cd6 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:49:12 +0545 Subject: [PATCH 06/18] Fix package uninstall command: remove -y flag for safer execution --- .github/actions/pkg-install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index 45ee353f..da244f29 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -74,5 +74,5 @@ runs: # TODO: reset env / consider add as conda run: | uv pip freeze > _reqs.txt - uv pip uninstall -y -r _reqs.txt + uv pip uninstall -r _reqs.txt shell: bash From 521c8e302deeea28f8f7e64f822f3ba0a55f022d Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:53:07 +0545 Subject: [PATCH 07/18] Fix test command line: use sys.executable for Python calls --- tests/unittests/cli/test_command_line.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unittests/cli/test_command_line.py b/tests/unittests/cli/test_command_line.py index a379adf5..63608103 100644 --- a/tests/unittests/cli/test_command_line.py +++ b/tests/unittests/cli/test_command_line.py @@ -1,4 +1,5 @@ import subprocess +import sys from pathlib import Path import pytest @@ -6,7 +7,7 @@ def test_version(): """Prints the help message for the requirements commands.""" - return_code = subprocess.call(["python", "-mlightning_utilities.cli", "version"]) # noqa: S607 + return_code = subprocess.call([sys.executable, "-m", "lightning_utilities.cli", "version"]) # noqa: S607 assert return_code == 0 @@ -14,7 +15,7 @@ def test_version(): class TestRequirements: """Test requirements commands.""" - BASE_CMD = ("python", "-m", "lightning_utilities.cli", "requirements") + BASE_CMD = (sys.executable, "-m", "lightning_utilities.cli", "requirements") REQUIREMENTS_SAMPLE = """ # This is sample requirements file # with multi line comments From 3374771405b502d80cb0e49fcffb1a4ab42d8afb Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 01:55:32 +0545 Subject: [PATCH 08/18] Fix test command line: correct noqa directive for version command --- tests/unittests/cli/test_command_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/cli/test_command_line.py b/tests/unittests/cli/test_command_line.py index 63608103..a4ff42a7 100644 --- a/tests/unittests/cli/test_command_line.py +++ b/tests/unittests/cli/test_command_line.py @@ -7,7 +7,7 @@ def test_version(): """Prints the help message for the requirements commands.""" - return_code = subprocess.call([sys.executable, "-m", "lightning_utilities.cli", "version"]) # noqa: S607 + return_code = subprocess.call([sys.executable, "-m", "lightning_utilities.cli", "version"]) # noqa: S603 assert return_code == 0 From 9fce72dff577e2d9d857f794288da240ade347e1 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 11:45:54 +0545 Subject: [PATCH 09/18] reverted to original --- .github/actions/cache/action.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index ae2327ee..0a399fd5 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -1,5 +1,5 @@ name: Complex caching -description: some more complex caching - conda +description: some more complex caching - pip & conda inputs: python-version: @@ -21,6 +21,19 @@ inputs: runs: using: "composite" steps: + - name: Determine caches + id: cache_dirs + run: echo "pip_dir=$(pip cache dir)" >> $GITHUB_OUTPUT + shell: bash + + - name: Cache πŸ’½ pip + uses: actions/cache@v3 + with: + path: ${{ steps.cache_dirs.outputs.pip_dir }} + key: py${{ inputs.python-version }}-pip-${{ inputs.offset }}-${{ hashFiles('requirements.txt') }} + restore-keys: py${{ inputs.python-version }}-pip-${{ inputs.offset }}- + enableCrossOsArchive: true + - name: Cache πŸ’½ conda uses: actions/cache@v3 if: runner.os == 'Linux' From 8fbcf5a1325c14cc85fc73d53bb5af02dc4c018a Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 11:46:39 +0545 Subject: [PATCH 10/18] Remove complex caching step from CI workflow --- .github/workflows/ci-testing.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 8f930b9d..61cc35d0 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -44,11 +44,6 @@ jobs: uv pip install -e '.[cli]' python -m lightning_utilities.cli requirements set-oldest - - name: Complex πŸ’½ caching - uses: ./.github/actions/cache - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies timeout-minutes: 20 run: | From 81bec279572a8665b4de44afc6496bf3d58d3bac Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 11:50:05 +0545 Subject: [PATCH 11/18] Reorganize uv cache minimization steps in CI workflow --- .github/workflows/check-schema.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-schema.yml b/.github/workflows/check-schema.yml index 16f106dd..b9408878 100644 --- a/.github/workflows/check-schema.yml +++ b/.github/workflows/check-schema.yml @@ -53,9 +53,6 @@ jobs: uv pip install -r ./.cicd/requirements/gha-schema.txt uv pip list | grep "check-jsonschema" - - name: Minimize uv cache - run: uv cache prune --ci - # otherwise fall back to using the latest - name: "[default] Install recommended dependencies" if: inputs.actions-ref == '' @@ -64,9 +61,6 @@ jobs: uv pip install -q check-jsonschema uv pip list | grep "check-jsonschema" - - name: Minimize uv cache - run: uv cache prune --ci - - name: Scan repo id: folders run: python -c "import os; print('gh_actions=' + str(int(os.path.isdir('.github/actions'))))" >> $GITHUB_OUTPUT @@ -101,3 +95,6 @@ jobs: echo $f; check-jsonschema -v $f --schemafile "$SCHEMA_FILE" --regex-variant="nonunicode"; done + + - name: Minimize uv cache + run: uv cache prune --ci From a78feefa22c5cdd1035ed6517e99d58908bd6cc9 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 12:12:03 +0545 Subject: [PATCH 12/18] update placement for mimize caching --- .github/workflows/check-docs.yml | 6 +++--- .github/workflows/check-package.yml | 11 ++++++----- .github/workflows/check-typing.yml | 6 +++--- .github/workflows/ci-cli.yml | 6 +++--- .github/workflows/ci-scripts.yml | 12 ++++++------ .github/workflows/ci-testing.yml | 6 +++--- .github/workflows/cleanup-caches.yml | 6 +++--- .github/workflows/deploy-docs.yml | 6 +++--- .github/workflows/release-pypi.yml | 6 +++--- 9 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index d48d7938..ab9c7bf7 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -98,9 +98,6 @@ jobs: uv pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL} uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: Pull reusable πŸ€– actions️ if: ${{ inputs.actions-ref != '' }} uses: actions/checkout@v5 @@ -128,3 +125,6 @@ jobs: path: ${{ inputs.docs-dir }}/build/ retention-days: ${{ env.KEEP_DAYS }} include-hidden-files: true + + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index ee1ddf47..261257ac 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -97,8 +97,6 @@ jobs: run: | uv pip install -q -r ./.cicd/requirements/gha-package.txt uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - name: Create package πŸ“¦ uses: ./.cicd/.github/actions/pkg-create - name: Upload πŸ“€ packages @@ -108,6 +106,9 @@ jobs: name: ${{ inputs.artifact-name }}-build-${{ strategy.job-index }} path: dist + - name: Minimize uv cache + run: uv cache prune --ci + merge-artifacts: needs: pkg-build runs-on: ubuntu-latest @@ -129,9 +130,6 @@ jobs: uv pip install -q -r ./.cicd/requirements/gha-package.txt uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: Download πŸ“₯ uses: actions/download-artifact@v6 with: @@ -149,6 +147,9 @@ jobs: name: ${{ inputs.artifact-name }} path: dist + - name: Minimize uv cache + run: uv cache prune --ci + pkg-check: needs: merge-artifacts runs-on: ${{ matrix.os }} diff --git a/.github/workflows/check-typing.yml b/.github/workflows/check-typing.yml index ec8fe3df..7334e3d1 100644 --- a/.github/workflows/check-typing.yml +++ b/.github/workflows/check-typing.yml @@ -54,9 +54,6 @@ jobs: --extra-index-url https://download.pytorch.org/whl/cpu/torch_stable.html uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: Pull reusable πŸ€– actions️ if: ${{ inputs.actions-ref != '' }} uses: actions/checkout@v5 @@ -101,3 +98,6 @@ jobs: | sed 's/\.py//g; s|${SOURCE_DIR}||g; s|\/__init__||g; s|\/|\.|g' \ | xargs -I {} echo '"{}",' \ || true + + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.github/workflows/ci-cli.yml b/.github/workflows/ci-cli.yml index 1a33867c..a66ddccc 100644 --- a/.github/workflows/ci-cli.yml +++ b/.github/workflows/ci-cli.yml @@ -34,9 +34,6 @@ jobs: uv pip install -e '.[cli]' uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: run CLI working-directory: ./requirements run: | @@ -45,6 +42,9 @@ jobs: python -m lightning_utilities.cli requirements set-oldest --req_files="cli.txt" python -m lightning_utilities.cli requirements set-oldest --req_files='["cli.txt", "docs.txt"]' + - name: Minimize uv cache + run: uv cache prune --ci + cli-guardian: runs-on: ubuntu-latest needs: test-cli diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index 02cf0aef..1f90e1b9 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -36,13 +36,13 @@ jobs: uv --version uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: test Scripts working-directory: ./scripts run: uv run pytest . -v + - name: Minimize uv cache + run: uv cache prune --ci + standalone-run: runs-on: "ubuntu-22.04" timeout-minutes: 20 @@ -66,14 +66,14 @@ jobs: uv --version uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: Run standalone script run: bash ./scripts/run_standalone_tests.sh "tests" env: COVERAGE_SOURCE: "lightning_utilities" + - name: Minimize uv cache + run: uv cache prune --ci + scripts-guardian: runs-on: ubuntu-latest needs: [test-scripts, standalone-run] diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 61cc35d0..354cc2f6 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -52,9 +52,6 @@ jobs: uv --version uv pip list - - name: Minimize uv cache - run: uv cache prune --ci - - name: Print πŸ–¨οΈ dependencies uses: ./.github/actions/pip-list @@ -83,6 +80,9 @@ jobs: working-directory: ./tests run: uv run python -m pytest scripts --durations=50 --timeout=120 + - name: Minimize uv cache + run: uv cache prune --ci + testing-guardian: runs-on: ubuntu-latest needs: pytester diff --git a/.github/workflows/cleanup-caches.yml b/.github/workflows/cleanup-caches.yml index 0d70a40f..de419340 100644 --- a/.github/workflows/cleanup-caches.yml +++ b/.github/workflows/cleanup-caches.yml @@ -58,9 +58,6 @@ jobs: timeout-minutes: 20 run: uv pip install -U -r ./.cicd/.github/scripts/find-unused-caches.txt - - name: Minimize uv cache - run: uv cache prune --ci - - name: List and Filer πŸ” caches run: | python ./.cicd/.github/scripts/find-unused-caches.py \ @@ -76,3 +73,6 @@ jobs: # delete each cache based on file... gh api --method DELETE -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/actions/caches/ $line; done < "unused-cashes.txt" + + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 723c8f16..dadf8ed1 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -46,9 +46,6 @@ jobs: uv pip list shell: bash - - name: Minimize uv cache - run: uv cache prune --ci - - name: Make Documentation working-directory: ./docs run: make html --jobs 2 @@ -63,3 +60,6 @@ jobs: clean: true # Automatically remove deleted files from the deploy branch target-folder: docs # If you'd like to push the contents of the deployment folder into a specific directory single-commit: true # you'd prefer to have a single commit on the deployment branch instead of full history + + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index 553ae09b..307ae0a7 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -30,9 +30,6 @@ jobs: enable-cache: true - name: Prepare build env. run: uv pip install -r ./requirements/gha-package.txt - - - name: Minimize uv cache - run: uv cache prune --ci - name: Create πŸ“¦ package uses: ./.github/actions/pkg-create - name: Upload πŸ“€ packages @@ -41,6 +38,9 @@ jobs: name: pypi-packages-${{ github.sha }} path: dist + - name: Minimize uv cache + run: uv cache prune --ci + upload-package: needs: build-package if: github.event_name == 'release' From ebd105724c2991a92f3c79fc98bc5a5292312729 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 12:19:47 +0545 Subject: [PATCH 13/18] Fix comments and update default age-days for cache cleanup --- .github/workflows/cron-clear-cache.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cron-clear-cache.yml b/.github/workflows/cron-clear-cache.yml index 61f1af82..41891440 100644 --- a/.github/workflows/cron-clear-cache.yml +++ b/.github/workflows/cron-clear-cache.yml @@ -29,6 +29,6 @@ jobs: with: scripts-ref: ${{ github.sha }} # use local version dry-run: ${{ github.event_name == 'pull_request' }} - # ise input if set of default... + # use input if set, otherwise default... pattern: ${{ inputs.pattern || 'pip|conda' }} - age-days: ${{ fromJSON(inputs.age-days) || 2 }} + age-days: ${{ inputs.age-days || 7 }} From c47e516add4ad0e923eb777a1d3d2d1079ae4c2d Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 12:26:24 +0545 Subject: [PATCH 14/18] Fix working directory for package installation from archive --- .github/actions/pkg-install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index da244f29..2c89b1fb 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -40,7 +40,7 @@ runs: - name: Install package (archive) if: ${{ inputs.install-from == 'archive' }} - working-directory: pypi/ + working-directory: ${{ inputs.pkg-folder }} run: | set -ex uv pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \ From 7f09d9a61fa7d59507e8bc1343ce08a3df59cec6 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 12:30:27 +0545 Subject: [PATCH 15/18] Add missing step to minimize uv cache in CI workflow --- .github/workflows/check-package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 261257ac..736545e3 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -200,6 +200,9 @@ jobs: import-name: ${{ inputs.import-name }} custom-import-code: ${{ inputs.custom-import-code }} + - name: Minimize uv cache + run: uv cache prune --ci + # TODO: add run doctests pkg-guardian: From af882348de2a464ae89d3d590385f0b5270f44d1 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 12:34:49 +0545 Subject: [PATCH 16/18] re-run From d3b5e0af22c0579111df3d738fc53334fd4d9a05 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 14:10:21 +0545 Subject: [PATCH 17/18] revert changes --- .github/actions/pkg-create/action.yml | 2 +- .github/actions/pkg-install/action.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/pkg-create/action.yml b/.github/actions/pkg-create/action.yml index de6fd5b7..0f31910f 100644 --- a/.github/actions/pkg-create/action.yml +++ b/.github/actions/pkg-create/action.yml @@ -6,7 +6,7 @@ runs: steps: - name: Create package πŸ“¦ # python setup.py clean - run: uv build --verbose + run: python -m build --verbose shell: bash - name: Check package πŸ“¦ diff --git a/.github/actions/pkg-install/action.yml b/.github/actions/pkg-install/action.yml index 2c89b1fb..b34c9c8d 100644 --- a/.github/actions/pkg-install/action.yml +++ b/.github/actions/pkg-install/action.yml @@ -32,10 +32,10 @@ runs: working-directory: ${{ inputs.pkg-folder }} run: | ls -lh - uv --version + pip -V echo "PKG_WHEEL=$(ls *.whl | head -n1)" >> $GITHUB_ENV echo "PKG_SOURCE=$(ls *.tar.gz | head -n1)" >> $GITHUB_ENV - uv pip list + pip list shell: bash - name: Install package (archive) @@ -43,9 +43,9 @@ runs: working-directory: ${{ inputs.pkg-folder }} run: | set -ex - uv pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \ + pip install '${{ env.PKG_SOURCE }}${{ inputs.pkg-extras }}' \ --force-reinstall ${{ inputs.pip-flags }} - uv pip list + pip list shell: bash - name: Install package (wheel) @@ -53,9 +53,9 @@ runs: working-directory: ${{ inputs.pkg-folder }} run: | set -ex - uv pip install '${{ env.PKG_WHEEL }}${{ inputs.pkg-extras }}' \ + pip install '${{ env.PKG_WHEEL }}${{ inputs.pkg-extras }}' \ --force-reinstall ${{ inputs.pip-flags }} - uv pip list + pip list shell: bash - name: package check / import @@ -73,6 +73,6 @@ runs: - name: Uninstall all # TODO: reset env / consider add as conda run: | - uv pip freeze > _reqs.txt - uv pip uninstall -r _reqs.txt + pip freeze > _reqs.txt + pip uninstall -y -r _reqs.txt shell: bash From e822e540d16d65e90c3f9cc76f5af2febb53a488 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 4 Dec 2025 14:11:07 +0545 Subject: [PATCH 18/18] revert package validation setup to use pip as the standard , (feedback from borda) --- .github/workflows/check-package.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-package.yml b/.github/workflows/check-package.yml index 736545e3..907b2d06 100644 --- a/.github/workflows/check-package.yml +++ b/.github/workflows/check-package.yml @@ -162,12 +162,11 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive - - name: Set up uv and Python 🐍 ${{ matrix.python-version }} - uses: astral-sh/setup-uv@v7 + # NOTE: use pip as gold standard for package validation + - name: Set up Python 🐍 ${{ matrix.python-version }} + uses: actions/setup-python@v6 with: - activate-environment: true python-version: ${{ matrix.python-version || '3.x' }} - enable-cache: true - name: Pull reusable πŸ€– actions️ uses: actions/checkout@v5 @@ -200,9 +199,6 @@ jobs: import-name: ${{ inputs.import-name }} custom-import-code: ${{ inputs.custom-import-code }} - - name: Minimize uv cache - run: uv cache prune --ci - # TODO: add run doctests pkg-guardian: