diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index b6b4c542..f41d181c 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -22,6 +22,8 @@ jobs: python-version: "3.11" - os: ubuntu-latest python-version: "3.12" + - os: ubuntu-latest + python-version: "3.13" - os: windows-latest python-version: "3.11" runs-on: ${{ matrix.os }} @@ -43,10 +45,15 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | python -m pip install 'pocketsphinx<5' - - name: Install Python dependencies (Ubuntu) - if: matrix.os == 'ubuntu-latest' + - name: Install Python dependencies (Ubuntu, <=3.12) + if: matrix.os == 'ubuntu-latest' && matrix.python-version != '3.13' run: | python -m pip install .[dev,audio,whisper-local,whisper-api] + - name: Install Python dependencies (Ubuntu, 3.13) + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' + run: | + python -m pip install standard-aifc setuptools + python -m pip install --no-build-isolation .[dev,audio,whisper-api] - name: Install Python dependencies (Windows) if: matrix.os == 'windows-latest' run: | diff --git a/tests/test_whisper_recognition.py b/tests/test_whisper_recognition.py index a0054961..4e7d76f0 100644 --- a/tests/test_whisper_recognition.py +++ b/tests/test_whisper_recognition.py @@ -1,11 +1,11 @@ -from unittest import TestCase +import sys +from unittest import TestCase, skipIf from unittest.mock import MagicMock, patch -import numpy as np - from speech_recognition import AudioData, Recognizer +@skipIf(sys.version_info >= (3, 13), "skip on Python 3.13") @patch("speech_recognition.io.BytesIO") @patch("soundfile.read") @patch("torch.cuda.is_available") @@ -14,6 +14,8 @@ class RecognizeWhisperTestCase(TestCase): def test_default_parameters( self, load_model, is_available, sf_read, BytesIO ): + import numpy as np + whisper_model = load_model.return_value transcript = whisper_model.transcribe.return_value audio_array = MagicMock()