Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipx run ruff check --fix --unsafe-fixes #359

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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