From 35026e2aa42dbec8ca5a3f61892d9b3cadb87582 Mon Sep 17 00:00:00 2001 From: Mathieu Bernard Date: Fri, 24 Nov 2023 19:08:29 +0100 Subject: [PATCH] fixing CI --- .github/workflows/doc.yaml | 4 ++-- .github/workflows/linux.yaml | 27 +++++++++++++++------------ .github/workflows/macos.yaml | 2 +- .github/workflows/windows.yaml | 2 +- .gitignore | 1 + test/test_punctuation.py | 11 ++++++----- 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/doc.yaml b/.github/workflows/doc.yaml index a658e54..8593837 100644 --- a/.github/workflows/doc.yaml +++ b/.github/workflows/doc.yaml @@ -15,7 +15,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [ 3.7 ] + python-version: [ 3.12 ] steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python-version }} @@ -24,7 +24,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools pip install .[doc] - name: Build documentation run: | diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index a80c590..8c3b8ef 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.10', '3.12'] steps: - name: Checkout phonemizer @@ -28,8 +28,8 @@ jobs: - name: Install phonemizer run: | - pip install --upgrade pip pytest pytest-cov - python setup.py install + pip install --upgrade pip pytest pytest-cov setuptools + pip install . - name: Version phonemizer run: phonemize --version @@ -38,7 +38,7 @@ jobs: run: pytest -v --cov=phonemizer --cov-report=xml test/ - name: Upload coverage to Codecov - if: ${{ matrix.python-version == '3.9' }} + if: ${{ matrix.python-version == '3.10' }} uses: codecov/codecov-action@v2 with: files: coverage.xml @@ -49,7 +49,10 @@ jobs: strategy: matrix: - espeak-version: ['1.48.03', '1.49.2', '1.50'] + # we used to test espeak-1.49 and 1.50 here but cannot be compiled + # anymore (ld error when linking speak-ng executable). I suppose some + # incompatbilty between old code / new compiler. + espeak-version: ['1.48.15', '1.51.1'] steps: - name: Checkout phonemizer @@ -61,14 +64,14 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install festival mbrola mbrola-fr1 + sudo apt-get install festival mbrola mbrola-fr1 mbrola-af1 - name: Install espeak-1.48 - if: ${{ matrix.espeak-version == '1.48.03' }} - run: sudo apt install espeak + if: ${{ matrix.espeak-version == '1.48.15' }} + run: sudo apt-get install espeak - name: Install espeak>=1.49 - if: ${{ matrix.espeak-version != '1.48.03' }} + if: ${{ matrix.espeak-version != '1.48.15' }} env: ESPEAK_VERSION: ${{ matrix.espeak-version }} run: | @@ -77,15 +80,15 @@ jobs: cd espeak-ng ./autogen.sh ./configure - make + make src/espeak-ng sudo make install sudo ldconfig espeak --version - name: Install phonemizer run: | - pip install --upgrade pip pytest - python setup.py install + pip install --upgrade pip pytest setuptools + pip install . - name: Version phonemizer run: phonemize --version diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 240f9ae..b21e5d2 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -46,7 +46,7 @@ jobs: - name: Install phonemizer run: | - pip install --upgrade pip + pip install --upgrade pip setuptools python setup.py install pip install --upgrade pytest diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 8fe65f1..a5d595b 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -50,7 +50,7 @@ jobs: - name: Install phonemizer run: | - pip install pytest + pip install pytest setuptools python setup.py install - name: Version phonemizer diff --git a/.gitignore b/.gitignore index 4a1486f..f082e9b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ htmlcov/* test/htmlcov paper/* .idea +*.~undo-tree~ docs/build \ No newline at end of file diff --git a/test/test_punctuation.py b/test/test_punctuation.py index 8e5ff25..7c31ee1 100644 --- a/test/test_punctuation.py +++ b/test/test_punctuation.py @@ -29,7 +29,7 @@ ESPEAK_150 = (EspeakBackend.version() >= (1, 50)) # True if we are using espeak>=1.49.3 -ESPEAK_143 = (EspeakBackend.version() >= (1, 49, 3)) +ESPEAK_149 = (EspeakBackend.version() >= (1, 49, 3)) # True if we are using festival>=2.5 FESTIVAL_25 = (FestivalBackend.version() >= (2, 5)) @@ -69,13 +69,14 @@ def test_preserve(inp): @pytest.mark.parametrize( 'text, expected_restore, expected_output', [ - (['hi; ho,"'], ['hi; ho," '], ['haɪ; hoʊ, ']), - (['hi; "ho,'], ['hi; "ho, '], ['haɪ; hoʊ, '] if ESPEAK_143 else ['haɪ; hoʊ, ']), - (['"hi; ho,'], ['"hi; ho, '], ['haɪ; hoʊ, '] if ESPEAK_143 else [' haɪ; hoʊ, '])]) + (['hi; hi,"'], ['hi; hi," '], ['haɪ; haɪ, ']), + (['hi; "hi,'], ['hi; "hi, '], ['haɪ; haɪ, '] if ESPEAK_149 else ['haɪ; haɪ, ']), + (['"hi; hi,'], ['"hi; hi, '], ['haɪ; haɪ, '] if ESPEAK_149 else [' haɪ; haɪ, '])]) def test_preserve_2(text, expected_restore, expected_output): marks = ".!;:,?" punct = Punctuation(marks=marks) - assert expected_restore == punct.restore(*punct.preserve(text), sep=default_separator, strip=False) + assert expected_restore == punct.restore( + *punct.preserve(text), sep=default_separator, strip=False) output = phonemize( text, backend="espeak",