Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Swapped tensorflow and pytorch to install only CPU version #2416

Merged
merged 5 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
35 changes: 35 additions & 0 deletions .github/actions/cpu_all_extras/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pip install all_extras with CPU versions
description: "For CI testing install the CPU version of dependencies with all extras if on ubuntu"

inputs:
additional_extras:
description: "Comma-separated list of additional extras to install"
required: false
default: ""

runs:
using: "composite"
steps:
- name: Install CPU TensorFlow
if: runner.os == 'Linux'
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install tensorflow-cpu

- name: Install CPU PyTorch
if: runner.os == 'Linux'
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: >
python -m pip install .[all_extras${{ inputs.additional_extras != '' && ',' || '' }}${{ inputs.additional_extras }}]
62 changes: 62 additions & 0 deletions .github/workflows/periodic_test_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Periodic test pytest
MatthewMiddlehurst marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "aeon/**"
- ".github/workflows/**"
- "pyproject.toml"


concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
pytest:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Use numba cache to set env variables but not restore cache
uses: ./.github/actions/numba_cache
with:
cache_name: "pytest"
runner_os: ${{ runner.os }}
python_version: ${{ matrix.python-version }}
restore_cache: "false"

- uses: ./.github/actions/cpu_all_extras
with:
additional_extras: "dev"

- name: Show dependencies
run: python -m pip list

- name: Run tests
run: python -m pytest -n logical

- name: Save new cache
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/.numba_cache
# Save cache with the current date (ENV set in numba_cache action)
key: numba-pytest-${{ runner.os }}-${{ matrix.python-version}}-${{ env.CURRENT_DATE }}
21 changes: 6 additions & 15 deletions .github/workflows/periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ jobs:
python_version: "3.10"
restore_cache: "false"

- name: Install dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,binder,dev]
additional_extras: "dev,binder"

- name: Run example notebooks
run: .github/utilities/run_examples.sh false
Expand Down Expand Up @@ -180,12 +177,9 @@ jobs:
python_version: ${{ matrix.python-version }}
restore_cache: "false"

- name: Install aeon and dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,dev]
additional_extras: "dev"

- name: Show dependencies
run: python -m pip list
Expand Down Expand Up @@ -215,12 +209,9 @@ jobs:
- name: Disable Numba JIT
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV

- name: Install aeon and dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,unstable_extras,dev]
additional_extras: "unstable_extras,dev"

- name: Show dependencies
run: python -m pip list
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pr_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ jobs:
runner_os: ${{ runner.os }}
python_version: "3.10"

- name: Install aeon and dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,binder,dev]
additional_extras: "dev,binder"

- name: Run example notebooks
run: .github/utilities/run_examples.sh ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full examples run') }}
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/pr_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ jobs:
runner_os: ${{ runner.os }}
python_version: ${{ matrix.python-version }}

- name: Install aeon and dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,dev]
additional_extras: "dev"

- name: Show dependencies
run: python -m pip list
Expand All @@ -120,12 +117,9 @@ jobs:
- name: Disable Numba JIT
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV

- name: Install aeon and dependencies
uses: nick-fields/retry@v3
- uses: ./.github/actions/cpu_all_extras
with:
timeout_minutes: 30
max_attempts: 3
command: python -m pip install .[all_extras,unstable_extras,dev]
additional_extras: "unstable_extras,dev"

- name: Show dependencies
run: python -m pip list
Expand Down
Loading