Skip to content

build(deps): unpin torch and remove torchvision from CPU requirements #11100

build(deps): unpin torch and remove torchvision from CPU requirements

build(deps): unpin torch and remove torchvision from CPU requirements #11100

Workflow file for this run

name: Tests
on:
push:
pull_request:
workflow_call:
release:
types: [created]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run_tests:
name: Test the code
strategy:
fail-fast: false
matrix:
backend: [tensorflow, jax, torch]
version: [keras-stable]
include:
- backend: jax
version: keras-3.15
- backend: jax
version: keras-nightly
- backend: openvino
version: keras-nightly
runs-on: ubuntu-latest
env:
KERAS_BACKEND: ${{ matrix.backend }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python 3.11
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.11'
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
# zizmor: ignore[cache-poisoning]
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off
pip install --no-deps -e "." --progress-bar off
- name: Pin Keras 3.15
if: ${{ matrix.version == 'keras-3.15'}}
run: |
pip uninstall -y keras jaxlib jax
pip install keras==3.15.0 --progress-bar off
pip install jax==0.6.0 --progress-bar off
- name: Pin Keras Nightly
if: ${{ matrix.version == 'keras-nightly'}}
run: |
pip uninstall -y keras
pip install keras-nightly --no-cache-dir --progress-bar off
- name: Test with pytest
run: |
pytest keras_hub/
- name: Run integration tests
run: |
python pip_build.py --install
cd integration_tests && pytest . -k "not NoTensorflow"
- name: Run no tensorflow integration test
if: ${{ matrix.backend != 'tensorflow'}}
run: |
pip uninstall -y tensorflow-text tensorflow
cd integration_tests && pytest . -k "NoTensorflow"
check_format:
name: Check the code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python 3.11
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.11'
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip setuptools
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
# zizmor: ignore[cache-poisoning]
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
pip install -r requirements.txt --progress-bar off
pip install --no-deps -e "." --progress-bar off
- name: Install pre-commit
run: pip install pre-commit && pre-commit install
- name: Run pre-commit
run: pre-commit run --all-files --hook-stage manual