Skip to content

Commit 2ad3634

Browse files
run ruff formatter in pre-commit
1 parent 806d311 commit 2ad3634

File tree

15 files changed

+7
-36
lines changed

15 files changed

+7
-36
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ repos:
3131
hooks:
3232
- id: ruff-check
3333
args: [--fix]
34-
# - id: ruff-format
35-
# ruff formatting currently disabled as it conflicts with Black
34+
- id: ruff-format
3635

3736
# 5) Black for experimental string processing
3837
- repo: https://github.com/psf/black-pre-commit-mirror

notebooks/ultimate_rvc_colab.ipynb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,7 @@
129129
" !lt --port 6969 >> url.txt 2>&1 &\n",
130130
" time.sleep(2)\n",
131131
" endpoint_ip = (\n",
132-
" request.urlopen(\"https://ipv4.icanhazip.com\")\n",
133-
" .read()\n",
134-
" .decode(\"utf8\")\n",
135-
" .strip(\"\\n\")\n",
132+
" request.urlopen(\"https://ipv4.icanhazip.com\").read().decode(\"utf8\").strip(\"\\n\")\n",
136133
" )\n",
137134
" tunnel_url = (\n",
138135
" Path(\"url.txt\").read_text(encoding=\"utf-8\").replace(\"your url is: \", \"\")\n",

src/ultimate_rvc/core/generate/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def wavify(
185185
]
186186
wav_path, wav_json_path = paths
187187
if not all(path.exists() for path in paths):
188-
189188
_, stderr = (
190189
ffmpeg.input(audio_path)
191190
.output(filename=wav_path, f="wav")
@@ -409,7 +408,6 @@ def convert(
409408
converted_audio_path, converted_audio_json_path = paths
410409

411410
if not all(path.exists() for path in paths):
412-
413411
rvc_model_path, rvc_index_path = _get_rvc_files(model_name)
414412

415413
voice_converter = _get_voice_converter()
@@ -601,7 +599,6 @@ def mix_audio(
601599
mix_path, mix_json_path = paths
602600

603601
if not all(path.exists() for path in paths):
604-
605602
_mix_audio(audio_path_gain_pairs, mix_path, output_sr, output_format)
606603
json_dump(args_dict, mix_json_path)
607604
return mix_path

src/ultimate_rvc/core/generate/song_cover.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def _get_audio_separator(
100100
segment_size: int = SegmentSize.SEG_256,
101101
sample_rate: int = 44100,
102102
) -> Separator:
103-
104103
static_ffmpeg.add_paths(weak=True)
105104
from audio_separator.separator import Separator # noqa: PLC0415
106105

src/ultimate_rvc/core/generate/speech.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def run_edge_tts(
251251
converted_audio_path, converted_audio_json_path = paths
252252

253253
if not all(path.exists() for path in paths):
254-
255254
pitch_shift_str = f"{pitch_shift:+}Hz"
256255
speed_change_str = f"{speed_change:+}%"
257256
volume_change_str = f"{volume_change:+}%"

src/ultimate_rvc/core/manage/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pathlib import Path
1313

1414
if TYPE_CHECKING:
15-
1615
from ultimate_rvc.typing_extra import StrPath
1716

1817

src/ultimate_rvc/web/config/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
)
2929

3030
if TYPE_CHECKING:
31-
3231
import gradio as gr
3332

3433

src/ultimate_rvc/web/tabs/generate/song_cover/multi_step_generation.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,11 @@ def _render_step_0(total_config: TotalConfig, cookiefile: str | None) -> None:
149149
value_indices=range(len(tab_config.song_dirs.all)),
150150
),
151151
inputs=current_song_dir,
152-
outputs=(
153-
[
154-
*tab_config.song_dirs.all,
155-
tab_config.cached_song.instance,
156-
total_config.song.one_click.cached_song.instance,
157-
]
158-
),
152+
outputs=[
153+
*tab_config.song_dirs.all,
154+
tab_config.cached_song.instance,
155+
total_config.song.one_click.cached_song.instance,
156+
],
159157
show_progress="hidden",
160158
).then(
161159
partial(update_dropdowns, get_named_song_dirs, 1, [], [0]),

src/ultimate_rvc/web/tabs/generate/song_cover/one_click_generation.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from ultimate_rvc.web.typing_extra import ConcurrencyId
3232

3333
if TYPE_CHECKING:
34-
3534
from ultimate_rvc.web.config.main import OneClickSongGenerationConfig, TotalConfig
3635

3736

@@ -228,7 +227,6 @@ def _render_main_options(tab_config: OneClickSongGenerationConfig) -> None:
228227

229228

230229
def _render_conversion_options(tab_config: OneClickSongGenerationConfig) -> None:
231-
232230
with gr.Accordion("Vocal conversion", open=False):
233231
gr.Markdown("")
234232
with gr.Accordion("Voice synthesis", open=False):
@@ -293,7 +291,6 @@ def _render_mixing_options(tab_config: OneClickSongGenerationConfig) -> None:
293291

294292

295293
def _render_output_options(tab_config: OneClickSongGenerationConfig) -> None:
296-
297294
with gr.Accordion("Audio output", open=False):
298295
with gr.Row():
299296
tab_config.output_name.instantiate(

src/ultimate_rvc/web/tabs/generate/speech/multi_step_generation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from ultimate_rvc.web.typing_extra import ConcurrencyId, SpeechTransferOption
3737

3838
if TYPE_CHECKING:
39-
4039
from ultimate_rvc.web.config.main import TotalConfig
4140

4241

@@ -201,7 +200,6 @@ def _render_step_2(total_config: TotalConfig) -> None:
201200
"Converted speech",
202201
)
203202
with gr.Row():
204-
205203
convert_speech_reset_btn = gr.Button("Reset settings")
206204
convert_speech_btn = gr.Button("Convert speech", variant="primary")
207205
converted_speech_transfer_btn = gr.Button("Transfer converted speech")

0 commit comments

Comments
 (0)