Skip to content

Commit

Permalink
Merge pull request #359 from cclauss/ruff-check
Browse files Browse the repository at this point in the history
`pipx run ruff check --fix --unsafe-fixes`
  • Loading branch information
willwade authored Nov 4, 2024
2 parents 5818c59 + 7a1fa83 commit 1939df4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ repos:
rev: v0.7.2
hooks: # Format before linting
- id: ruff-format
# - id: ruff
- id: ruff
2 changes: 1 addition & 1 deletion example/repeatvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def text_to_speech(text):

def speech_to_text():
r = s.Recognizer() # an object r which recognises the voice
with s.Microphone() as source:
with s.Microphone():
# when using with statement. The with statement itself ensures proper acquisition and release of resources
print(r.recognize_google(audio))
text_to_speech(r.recognize_google(audio))
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ urls = { Homepage = "https://github.com/nateshmbhat/pyttsx3" }
[tool.setuptools]
packages = [ "pyttsx3", "pyttsx3.drivers" ]
include-package-data = false

[tool.ruff]
target-version = "py39"
line-length = 88
lint.extend-ignore = [ "F403", "F405", "F821" ]
2 changes: 1 addition & 1 deletion pyttsx3/drivers/_espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def load_library():
raise RuntimeError(
"This means you probably do not have eSpeak or eSpeak-ng installed!"
)
except Exception as exp:
except Exception:
raise

# constants and such from speak_lib.h
Expand Down
2 changes: 1 addition & 1 deletion pyttsx3/drivers/espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def getProperty(name: str):
"utf-8", errors="ignore"
)
kwargs["languages"] = [language_code]
except UnicodeDecodeError as e:
except UnicodeDecodeError:
kwargs["languages"] = ["Unknown"]
genders = [None, "male", "female"]
kwargs["gender"] = genders[v.gender]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyttsx3.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from __future__ import annotations

import sys
import wave
from unittest import mock

import pytest
import wave

import pyttsx3

Expand Down

0 comments on commit 1939df4

Please sign in to comment.