diff --git a/Makefile b/Makefile index faab840..58c2d04 100755 --- a/Makefile +++ b/Makefile @@ -81,9 +81,7 @@ g2p: $(G2P_MODELS) # Testing # ----------------------------------------------------------------------------- -mypy: - mypy app.py rhasspy - check: flake8 --exclude=lexconvert.py app.py test.py rhasspy/*.py pylint --ignore=lexconvert.py app.py test.py rhasspy/*.py + mypy app.py test.py rhasspy/*.py diff --git a/mypy.ini b/mypy.ini index 1756af6..610e49f 100644 --- a/mypy.ini +++ b/mypy.ini @@ -72,6 +72,9 @@ ignore_missing_imports = True [mypy-json5.*] ignore_missing_imports = True +[mypy-quart.*] +ignore_missing_imports = True + [mypy-quart_cors.*] ignore_missing_imports = True diff --git a/rhasspy/dialogue.py b/rhasspy/dialogue.py index 0b45416..051703d 100755 --- a/rhasspy/dialogue.py +++ b/rhasspy/dialogue.py @@ -768,7 +768,7 @@ class DialogueManager(RhasspyActor): chunk_size = int(self.profile.get(test_path, 1024)) assert recorder_class is not None - test_mics = recorder_class.test_microphones(chunk_size) + test_mics = recorder_class.test_microphones(chunk_size) # type: ignore self.send(sender, test_mics) elif isinstance(message, GetSpeakers): # Get all speakers diff --git a/rhasspy/intent.py b/rhasspy/intent.py index c0e4a1f..604388f 100755 --- a/rhasspy/intent.py +++ b/rhasspy/intent.py @@ -517,6 +517,7 @@ class AdaptIntentRecognizer(RhasspyActor): def load_engine(self) -> None: """Configure Adapt engine if not already cached.""" if self.engine is None: + # pylint: disable=E0401 from adapt.intent import IntentBuilder from adapt.engine import IntentDeterminationEngine diff --git a/rhasspy/lexconvert.py b/rhasspy/lexconvert.py index 1666df3..d85de0e 100755 --- a/rhasspy/lexconvert.py +++ b/rhasspy/lexconvert.py @@ -22,6 +22,7 @@ # and on Bitbucket https://bitbucket.org/ssb22/lexconvert # although some early ones are missing. +# type: ignore def Phonemes(): """Create phonemes by calling vowel(), consonant(), @@ -305,9 +306,9 @@ def LexFormats(): lex_header=";; -*- mode: lisp -*-\n(eval (list voice_default))\n", lex_read_function=lambda *args: eval( "[" - + commands.getoutput( - "grep -vi parameter.set < ~/.festivalrc | grep -v '(eval' | sed -e 's/;.*//' -e 's/.lex.add.entry//' -e s/\"'\"'[(] *\"/[\"/' -e 's/\" [^ ]* /\",(\"/' -e 's/\".*$/&\"],/' -e 's/[()]/ /g' -e 's/ */ /g'" - ) + # + commands.getoutput( + # "grep -vi parameter.set < ~/.festivalrc | grep -v '(eval' | sed -e 's/;.*//' -e 's/.lex.add.entry//' -e s/\"'\"'[(] *\"/[\"/' -e 's/\" [^ ]* /\",(\"/' -e 's/\".*$/&\"],/' -e 's/[()]/ /g' -e 's/ */ /g'" + # ) + "]" ), safe_to_drop_characters=True, # TODO: really? (could instead give a string of known-safe characters) @@ -3317,7 +3318,7 @@ def make_dictionary(sourceName, destName): return d -warnedAlready = set() +warnedAlready = set() # type: ignore def convert(pronunc, source, dest): @@ -4569,7 +4570,7 @@ class MacBritish_System_Lexicon(object): so you can substitute these into your texts. Restores the lexicon on close().""" - instances = {} + instances = {} # type: ignore def __init__(self, text="", voice="Daniel"): """text is the text you want to speak (so that any diff --git a/rhasspy/stt.py b/rhasspy/stt.py index aaa917c..bdaa50f 100755 --- a/rhasspy/stt.py +++ b/rhasspy/stt.py @@ -565,7 +565,7 @@ class HomeAssistantSTTIntegration(RhasspyActor): audio_data = audio_data[self.chunk_size :] # POST WAV data to STT - response = requests.post(stt_url, data=generate_chunks(), **kwargs) + response = requests.post(stt_url, data=generate_chunks(), **kwargs) # type: ignore response.raise_for_status() response_json = response.json() diff --git a/rhasspy/train/__init__.py b/rhasspy/train/__init__.py index 1cf9c84..de3b5de 100644 --- a/rhasspy/train/__init__.py +++ b/rhasspy/train/__init__.py @@ -459,7 +459,7 @@ def train_profile(profile_dir: Path, profile: Profile) -> Tuple[int, List[str]]: # This better thing to do would be to create a custom TaskLoader. import inspect - inspect.getsourcelines = lambda obj: [0, 0] + inspect.getsourcelines = lambda obj: [0, 0] # type: ignore # Run doit main result = DoitMain(ModuleTaskLoader(locals())).run(sys.argv[1:]) diff --git a/rhasspy/tts.py b/rhasspy/tts.py index 69b27c0..b11b765 100755 --- a/rhasspy/tts.py +++ b/rhasspy/tts.py @@ -717,6 +717,7 @@ class GoogleWaveNetSentenceSpeaker(RhasspyActor): self.sample_rate, ) + # pylint: disable=E0401 from google.cloud import texttospeech client = texttospeech.TextToSpeechClient()