Skip to content

Commit b7e39bc

Browse files
committed
chore: actions bumps + ruff formatting
-checkout@v4 → v5, setup-buildx-action@v3 → v4 across all workflows. -Ruff formatting pass: quote style, import order, line length.
1 parent 2153529 commit b7e39bc

19 files changed

Lines changed: 142 additions & 105 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

1818
# Match Dockerfile dependencies
1919
- name: Install Dependencies

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fi
3737
3838
- name: Checkout repository
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
4040
with:
4141
ref: ${{ steps.resolve-ref.outputs.source_ref }}
4242
fetch-depth: 0
@@ -100,7 +100,7 @@ jobs:
100100
runs-on: ${{ matrix.runs_on }}
101101
steps:
102102
- name: Checkout repository
103-
uses: actions/checkout@v4
103+
uses: actions/checkout@v5
104104
with:
105105
ref: ${{ needs.prepare-release.outputs.source_ref }}
106106

@@ -115,14 +115,14 @@ jobs:
115115
df -h
116116
117117
- name: Set up Docker Buildx
118-
uses: docker/setup-buildx-action@v3 # Use v3
118+
uses: docker/setup-buildx-action@v4
119119
with:
120120
driver-opts: |
121121
image=moby/buildkit:v0.21.1
122122
network=host
123123
124124
- name: Log in to GitHub Container Registry
125-
uses: docker/login-action@v3 # Use v3
125+
uses: docker/login-action@v3
126126
with:
127127
registry: ghcr.io
128128
username: ${{ github.actor }}
@@ -276,7 +276,7 @@ jobs:
276276
contents: write
277277
steps:
278278
- name: Checkout repository
279-
uses: actions/checkout@v4
279+
uses: actions/checkout@v5
280280
with:
281281
fetch-depth: 0
282282

.github/workflows/test_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
runs-on: ${{ matrix.runs_on }}
8080
steps:
8181
- name: Checkout repository
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@v5
8383
with:
8484
ref: ${{ inputs.branch_name }}
8585

@@ -88,7 +88,7 @@ jobs:
8888
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
8989
9090
- name: Set up Docker Buildx
91-
uses: docker/setup-buildx-action@v3
91+
uses: docker/setup-buildx-action@v4
9292
with:
9393
driver-opts: image=moby/buildkit:v0.21.1
9494

.github/workflows/test_client_image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
OWNER: ${{ vars.OWNER || 'remsky' }}
4545
IMAGE_NAME: ${{ vars.TEST_CLIENT_IMAGE_NAME || 'tts-api-test-client' }}
4646
steps:
47-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v5
4848

4949
- name: Resolve image refs
5050
id: refs
@@ -61,7 +61,7 @@ jobs:
6161
echo "latest=${BASE}:latest" >> "$GITHUB_OUTPUT"
6262
6363
- name: Set up Docker Buildx
64-
uses: docker/setup-buildx-action@v3
64+
uses: docker/setup-buildx-action@v4
6565

6666
- name: Log in to GHCR
6767
if: github.event_name != 'workflow_dispatch' || inputs.push

api/src/core/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from importlib.metadata import PackageNotFoundError, version as _pkg_version
1+
from importlib.metadata import (
2+
PackageNotFoundError,
3+
version as _pkg_version,
4+
)
25
from pathlib import Path
36

47
import torch

api/src/routers/development.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ async def dual_output():
226226
# Add any chunks that may be in the acumulator into the return word_timestamps
227227
if chunk_data.word_timestamps is not None:
228228
chunk_data.word_timestamps = (
229-
timestamp_acumulator + chunk_data.word_timestamps
229+
timestamp_acumulator
230+
+ chunk_data.word_timestamps
230231
)
231232
timestamp_acumulator = []
232233
else:

api/src/routers/web_player.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ async def get_web_config():
2020
"""Get web player configuration including UVICORN_ROOT_PATH."""
2121
if not settings.enable_web_player:
2222
raise HTTPException(status_code=404, detail="Web player is disabled")
23-
23+
2424
root_path = os.environ.get("UVICORN_ROOT_PATH", "")
25-
25+
2626
return {
2727
"root_path": root_path,
2828
"version": settings.api_version,

api/src/services/streaming_audio_writer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,29 @@ def __init__(self, format: str, sample_rate: int, channels: int = 1):
3434
self.output_buffer = BytesIO()
3535
container_options = {}
3636
# Try disabling Xing VBR header for MP3 to fix iOS timeline reading issues
37-
if self.format == 'mp3':
37+
if self.format == "mp3":
3838
# Disable Xing VBR header
39-
container_options = {'write_xing': '0'}
39+
container_options = {"write_xing": "0"}
4040
logger.debug("Disabling Xing VBR header for MP3 encoding.")
4141

4242
self.container = av.open(
4343
self.output_buffer,
4444
mode="w",
4545
format=self.format if self.format != "aac" else "adts",
46-
options=container_options # Pass options here
46+
options=container_options, # Pass options here
4747
)
4848
self.stream = self.container.add_stream(
4949
codec_map[self.format],
5050
rate=self.sample_rate,
5151
layout="mono" if self.channels == 1 else "stereo",
5252
)
5353
# Set bit_rate only for codecs where it's applicable and useful
54-
if self.format in ['mp3', 'aac', 'opus']:
54+
if self.format in ["mp3", "aac", "opus"]:
5555
self.stream.bit_rate = 128000
5656
else:
57-
raise ValueError(f"Unsupported format: {self.format}") # Use self.format here
57+
raise ValueError(
58+
f"Unsupported format: {self.format}"
59+
) # Use self.format here
5860

5961
def close(self):
6062
if hasattr(self, "container"):

api/src/services/text_processing/normalizer.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import inflect
1313
from numpy import number
14+
1415
# from text_to_num import text2num
1516
from torch import mul
1617

@@ -135,20 +136,20 @@
135136
}
136137

137138
SYMBOL_REPLACEMENTS = {
138-
'~': ' ',
139-
'@': ' at ',
140-
'#': ' number ',
141-
'$': ' dollar ',
142-
'%': ' percent ',
143-
'^': ' ',
144-
'&': ' and ',
145-
'*': ' ',
146-
'_': ' ',
147-
'|': ' ',
148-
'\\': ' ',
149-
'/': ' slash ',
150-
'=': ' equals ',
151-
'+': ' plus ',
139+
"~": " ",
140+
"@": " at ",
141+
"#": " number ",
142+
"$": " dollar ",
143+
"%": " percent ",
144+
"^": " ",
145+
"&": " and ",
146+
"*": " ",
147+
"_": " ",
148+
"|": " ",
149+
"\\": " ",
150+
"/": " slash ",
151+
"=": " equals ",
152+
"+": " plus ",
152153
}
153154

154155
MONEY_UNITS = {"$": ("dollar", "cent"), "£": ("pound", "pence"), "€": ("euro", "cent")}
@@ -408,7 +409,7 @@ def handle_time(t: re.Match[str]) -> str:
408409

409410
def normalize_text(text: str, normalization_options: NormalizationOptions) -> str:
410411
"""Normalize text for TTS processing"""
411-
412+
412413
# Handle email addresses first if enabled
413414
if normalization_options.email_normalization:
414415
text = EMAIL_PATTERN.sub(handle_email, text)
@@ -455,9 +456,9 @@ def normalize_text(text: str, normalization_options: NormalizationOptions) -> st
455456

456457
# Handle special characters that might cause audio artifacts first
457458
# Replace newlines with spaces (or pauses if needed)
458-
text = text.replace('\n', ' ')
459-
text = text.replace('\r', ' ')
460-
459+
text = text.replace("\n", " ")
460+
text = text.replace("\r", " ")
461+
461462
# Handle titles and abbreviations
462463
text = re.sub(r"\bD[Rr]\.(?= [A-Z])", "Doctor", text)
463464
text = re.sub(r"\b(?:Mr\.|MR\.(?= [A-Z]))", "Mister", text)

api/src/services/text_processing/phonemizer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import phonemizer
55

6-
from .normalizer import normalize_text
76
from ...structures.schemas import NormalizationOptions
7+
from .normalizer import normalize_text
88

99
phonemizers = {}
1010

@@ -95,13 +95,13 @@ def phonemize(text: str, language: str = "a") -> str:
9595
Phonemized text
9696
"""
9797
global phonemizers
98-
98+
9999
# Strip input text first to remove problematic leading/trailing spaces
100100
text = text.strip()
101-
101+
102102
if language not in phonemizers:
103103
phonemizers[language] = create_phonemizer(language)
104-
104+
105105
result = phonemizers[language].phonemize(text)
106106
# Final strip to ensure no leading/trailing spaces in phonemes
107107
return result.strip()

0 commit comments

Comments
 (0)