From a61ae2e3a2ac703285953c2ebe51f249bafb2458 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 4 Nov 2024 21:24:54 +0100 Subject: [PATCH] Enable both eSpeak-NG on Windows --- .github/workflows/python_publish.yml | 11 ++++++++++- tests/test_engines.py | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python_publish.yml b/.github/workflows/python_publish.yml index 2d660bc..a77154e 100644 --- a/.github/workflows/python_publish.yml +++ b/.github/workflows/python_publish.yml @@ -1,4 +1,4 @@ -# This workflows will upload a Python Package using Twine when a release is created. +# This workflow will upload a Python Package using Twine when a release is created. # https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries name: CI @@ -34,6 +34,15 @@ jobs: run: sudo apt-get update -q -q && sudo apt-get install --yes espeak-ng libespeak1 - if: runner.os == 'macOS' run: brew install espeak-ng + - name: Download and install eSpeak-NG + if: runner.os == 'Windows' + shell: pwsh + run: | + Invoke-WebRequest -Uri "https://github.com/espeak-ng/espeak-ng/releases/download/1.51/espeak-ng-X64.msi" -OutFile "espeak-ng.msi" + Start-Process msiexec.exe -ArgumentList '/i espeak-ng.msi /quiet /norestart' -Wait + # dir "$env:ProgramFiles\eSpeak NG" + $env:Path += ";$env:ProgramFiles\eSpeak NG" + espeak-ng --version - if: runner.os != 'Windows' run: espeak-ng --version diff --git a/tests/test_engines.py b/tests/test_engines.py index 8c7d071..2d898b5 100644 --- a/tests/test_engines.py +++ b/tests/test_engines.py @@ -9,9 +9,6 @@ quick_brown_fox = "The quick brown fox jumped over the lazy dog." -@pytest.mark.skipif( - sys.platform == "win32", reason="TODO: Install eSpeak-NG on Windows" -) @pytest.mark.parametrize("driver_name", pyttsx3.engine.engines_by_sys_platform()) def test_engine_name(driver_name): engine = pyttsx3.init(driver_name) @@ -22,7 +19,7 @@ def test_engine_name(driver_name): @pytest.mark.skipif( - sys.platform == "win32", reason="TODO: Install eSpeak-NG on Windows" + sys.platform == "win32", reason="TODO: Make this test pass on eSpeak-NG on Windows" ) @pytest.mark.parametrize("driver_name", pyttsx3.engine.engines_by_sys_platform()) def test_speaking_text(driver_name):