Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Complex caching
description: some more complex caching - pip & conda
description: some more complex caching - conda

inputs:
python-version:
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/pip-list/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ runs:
echo '<summary>pip list</summary>' >> $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 '</details>' >> $GITHUB_STEP_SUMMARY
pip list # also print to stdout
uv pip list # also print to stdout
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/pkg-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 📦
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/pkg-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,30 @@ 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)
if: ${{ inputs.install-from == 'archive' }}
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)
if: ${{ inputs.install-from == 'wheel' }}
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
Expand All @@ -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
16 changes: 10 additions & 6 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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' }}
Expand All @@ -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 != '' }}
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/check-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/check-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/check-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/check-typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '' }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/ci-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/ci-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
Loading