Skip to content

Commit

Permalink
fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmaat committed Nov 24, 2023
1 parent daf9d7b commit 35026e2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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: |
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Install phonemizer
run: |
pip install pytest
pip install pytest setuptools
python setup.py install
- name: Version phonemizer
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ htmlcov/*
test/htmlcov
paper/*
.idea
*.~undo-tree~

docs/build
11 changes: 6 additions & 5 deletions test/test_punctuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 35026e2

Please sign in to comment.