diff --git a/.gitignore b/.gitignore index 83214be..807dc3c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ __pycache__/ /download/ /gruut/ *.onnx -.dockerignore \ No newline at end of file +.dockerignore +.coverage +coverage.xml diff --git a/espeak_phonemizer/VERSION b/espeak_phonemizer/VERSION index afaf360..7dea76e 100644 --- a/espeak_phonemizer/VERSION +++ b/espeak_phonemizer/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 diff --git a/espeak_phonemizer/__init__.py b/espeak_phonemizer/__init__.py index 299aaf6..a09472e 100644 --- a/espeak_phonemizer/__init__.py +++ b/espeak_phonemizer/__init__.py @@ -103,18 +103,16 @@ class Phonemizer: self.lib_espeak.espeak_SetPhonemeTrace(phoneme_flags, phonemes_file) - identifier = ctypes.c_uint() - user_data = ctypes.c_void_p() text_bytes = text.encode("utf-8") self.lib_espeak.espeak_Synth( text_bytes, - 0, # buflength + 0, # buflength (unused in AUDIO_OUTPUT_SYNCHRONOUS mode) 0, # position 0, # position_type - 0, # end_position + 0, # end_position (no end position) Phonemizer.espeakCHARS_AUTO | Phonemizer.espeakPHONEMES, - identifier, - user_data, + None, # unique_speaker, + None, # user_data, ) self.libc.fflush(phonemes_file) @@ -162,7 +160,7 @@ class Phonemizer: def _maybe_init(self): if self.libc and self.lib_espeak: - # Already initialize + # Already initialized return self.libc = ctypes.cdll.LoadLibrary("libc.so.6") diff --git a/requirements_dev.txt b/requirements_dev.txt index ab6cb3e..e2c0e77 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ black==19.10b0 coverage==5.0.4 flake8==3.7.9 -mypy==0.770 -pylint==2.4.4 +mypy==0.910 +pylint==2.10.2 pytest==5.4.1 pytest-cov==2.8.1 diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh new file mode 100755 index 0000000..c38920d --- /dev/null +++ b/scripts/run-tests.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -e pipefail + +# Directory of *this* script +this_dir="$( cd "$( dirname "$0" )" && pwd )" +src_dir="$(realpath "${this_dir}/..")" + +if [[ "$1" == '--no-venv' ]]; then + no_venv='1' +fi + +if [[ -z "${no_venv}" ]]; then + venv="${src_dir}/.venv" + if [[ -d "${venv}" ]]; then + source "${venv}/bin/activate" + fi +fi + +# ----------------------------------------------------------------------------- + +export PYTHONPATH="${src_dir}" + +coverage run "--source=${src_dir}/espeak_phonemizer" -m pytest +coverage report -m +coverage xml + +# ----------------------------------------------------------------------------- + +echo "OK"