Rename module src/tts_mcp → src/mcspeak
Standard src-layout: package name matches import name. All internal imports are relative so no code changes needed beyond pyproject.toml. Also fixes 4 pre-existing ruff line-length violations.
This commit is contained in:
parent
d054caa43c
commit
402a877726
@ -23,10 +23,10 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
mcspeak = "tts_mcp.__main__:main"
|
mcspeak = "mcspeak.__main__:main"
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = ["src/tts_mcp"]
|
packages = ["src/mcspeak"]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
|
|||||||
@ -103,7 +103,8 @@ async def app_lifespan(server: FastMCP):
|
|||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
f" Shutdown budget: 3s handler drain + {settings.shutdown_timeout:.0f}s queue drain + 5s safety",
|
f" Shutdown budget: 3s handler drain + "
|
||||||
|
f"{settings.shutdown_timeout:.0f}s queue drain + 5s safety",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -351,10 +352,13 @@ async def _speak_chunked(
|
|||||||
if not enqueue_result.get("queued"):
|
if not enqueue_result.get("queued"):
|
||||||
# Queue full mid-message — already-enqueued chunks play through
|
# Queue full mid-message — already-enqueued chunks play through
|
||||||
if all_speech_ids:
|
if all_speech_ids:
|
||||||
await ctx.info(f"Queue full at chunk {i + 1}/{n_chunks}, waiting for enqueued chunks...")
|
msg = f"Queue full at chunk {i + 1}/{n_chunks}, waiting for enqueued chunks..."
|
||||||
|
await ctx.info(msg)
|
||||||
elapsed = time.time() - first_enqueue_time if first_enqueue_time else 0
|
elapsed = time.time() - first_enqueue_time if first_enqueue_time else 0
|
||||||
remaining = max(total_duration - elapsed, 0.1)
|
remaining = max(total_duration - elapsed, 0.1)
|
||||||
outcome = await _await_with_progress(queue, all_speech_ids[-1], remaining, ctx, 35)
|
outcome = await _await_with_progress(
|
||||||
|
queue, all_speech_ids[-1], remaining, ctx, 35
|
||||||
|
)
|
||||||
outcome["chunks_enqueued"] = len(all_speech_ids)
|
outcome["chunks_enqueued"] = len(all_speech_ids)
|
||||||
outcome["chunks_total"] = n_chunks
|
outcome["chunks_total"] = n_chunks
|
||||||
return outcome
|
return outcome
|
||||||
@ -112,7 +112,10 @@ class VoiceIdentityCache:
|
|||||||
data = json.loads(self._persist_path.read_text())
|
data = json.loads(self._persist_path.read_text())
|
||||||
self._assignments = data.get("assignments", {})
|
self._assignments = data.get("assignments", {})
|
||||||
count = sum(len(v) for v in self._assignments.values())
|
count = sum(len(v) for v in self._assignments.values())
|
||||||
print(f" Voice identity: loaded {count} assignments from {self._persist_path}", file=sys.stderr)
|
print(
|
||||||
|
f" Voice identity: loaded {count} assignments from {self._persist_path}",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
print(f" Voice identity: failed to load {self._persist_path} ({exc})", file=sys.stderr)
|
print(f" Voice identity: failed to load {self._persist_path} ({exc})", file=sys.stderr)
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user