Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
97 lines (85 loc) · 2.63 KB
/
Copy pathpyproject.toml
File metadata and controls
97 lines (85 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[project]
name = "polyglot"
version = "1.0.0"
description = "Live transcription, translation and reply suggestions in a small always-on-top window."
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [{ name = "Yousef Alhashemi" }]
dependencies = [
"numpy>=1.26",
"soxr>=0.5",
"onnxruntime>=1.17",
"faster-whisper>=1.1",
"sounddevice>=0.5",
"PyAudioWPatch>=0.2.12; sys_platform == 'win32'",
"PyQt6>=6.7",
"pydantic>=2.7",
"platformdirs>=4.2",
"keyring>=25.0",
"tomli>=2.0; python_version < '3.11'",
"pynput>=1.7",
]
[project.optional-dependencies]
# Alternative speech engines (asr.engine). Whisper stays installed either way: Silero VAD
# ships inside faster-whisper. Neither engine needs NVIDIA hardware.
parakeet = ["onnx-asr[hub]>=0.12"] # ONNX Runtime: any CPU; DirectML/CUDA GPUs if installed
qwen3 = ["qwen-asr>=0.0.6"] # PyTorch: CPU, or a CUDA GPU
[project.scripts]
polyglot = "polyglot.__main__:main"
[dependency-groups]
dev = [
"pytest>=8.2",
"pytest-qt>=4.4",
"pytest-timeout>=2.3",
"pytest-cov>=5.0",
"ruff==0.14.0",
"mypy>=1.11",
]
[build-system]
requires = ["hatchling>=1.27"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/polyglot"]
[tool.uv]
default-groups = ["dev"]
# ---------------------------------------------------------------- pytest
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
addopts = "-ra --strict-markers -m 'not slow'"
timeout = 60
markers = [
"slow: needs real models (Whisper/Silero, Parakeet/Qwen3 if installed); deselected by default, run with -m slow",
"ui: needs Qt (runs offscreen)",
]
qt_api = "pyqt6"
# ---------------------------------------------------------------- ruff
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "PT", "C4", "N"]
ignore = [
"E501", # line length is the formatter's job
"N818", # exception names describe the condition (ProviderTimeout)
"PT018", # compound asserts are fine in tests
"N802", # Qt overrides use camelCase
"RUF001", # ambiguous unicode in UI strings is intentional
"RUF002",
"RUF003",
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["PT011", "E402"]
# ---------------------------------------------------------------- mypy
[tool.mypy]
python_version = "3.10"
plugins = ["pydantic.mypy"]
warn_unused_ignores = true
warn_redundant_casts = true
ignore_missing_imports = true
files = ["src/polyglot"]
[[tool.mypy.overrides]]
module = ["polyglot.core.*", "polyglot.config"]
strict = true