Skip to content
19 changes: 13 additions & 6 deletions .github/workflows/ci-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,29 @@ jobs:
env:
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }}
UV_TORCH_BACKEND: "cpu"

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6

- name: Install uv and set Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
activate-environment: true
enable-cache: true

- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
pip install 'lightning-utilities[cli]'
uv pip install 'lightning-utilities[cli]'
python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt"]'

- name: Install package & dependencies
run: |
pip --version
pip install -e '.[test,extra]' -U -q --find-links $TORCH_URL
pip list
uv --version
uv pip install -e '.[test,extra]' --find-links="${TORCH_URL}"
uv pip list

- name: Test integrations
env:
Expand All @@ -91,6 +95,9 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

- name: Minimize uv cache
run: uv cache prune --ci

integration-guardian:
runs-on: ubuntu-latest
needs: integration
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,27 @@ jobs:
env:
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }}
UV_TORCH_BACKEND: "cpu"

steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6

- name: Install uv and set Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
activate-environment: true
enable-cache: true

- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
pip install 'lightning-utilities[cli]'
uv pip install 'lightning-utilities[cli]'
python -m lightning_utilities.cli requirements set-oldest --req_files='["requirements.txt"]'

- name: Adjust requirements
run: |
pip install 'lightning-utilities[cli]' -U -q
uv pip install 'lightning-utilities[cli]' -q
python -m lightning_utilities.cli requirements replace-pkg \
--old_package="lightning" \
--new_package="${{matrix.dependency}}" \
Expand All @@ -64,9 +67,9 @@ jobs:
- name: Install package & dependencies
run: |
set -e
pip --version
pip install -e '.[test,extra]' -U -q --find-links $TORCH_URL
pip list
uv --version
uv pip install -e '.[test,extra]' --find-links="${TORCH_URL}"
uv pip list
# check that right package was installed
python -c "import ${{matrix.dependency}}; print(${{matrix.dependency}}.__version__)"

Expand All @@ -90,6 +93,9 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

- name: Minimize uv cache
run: uv cache prune --ci

tests-guardian:
runs-on: ubuntu-latest
needs: pytester
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ name: PyPI Release
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
paths:
- ".github/workflows/release-pypi.yml"
release:
types: [published]

Expand All @@ -12,18 +16,27 @@ on: # Trigger the workflow on push or pull request, but only for the main branch
jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: actions/checkout@v6

- name: Install uv and set Python 3.10
uses: astral-sh/setup-uv@v7
with:
python-version: "3.10"
activate-environment: true
enable-cache: true

- name: Install dependencies
run: pip install -U -r _requirements/_ci.txt
run: |
uv pip install -U -r _requirements/_ci.txt
uv pip list

- name: Build package
run: python -m build

- name: Check package
run: twine check dist/*
run: twine check dist/* --strict

# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
Expand Down
Loading