-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
178 lines (153 loc) · 4.84 KB
/
pyproject.toml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
[tool.poetry]
name = "transcription-bot"
version = "0.0.1"
package-mode = true
description = ""
authors = []
license = "CC0"
readme = "README.md"
packages = [{ include = "transcription_bot" }]
[tool.poetry.dependencies]
python = ">=3.11,<3.12"
feedparser = "^6.0.11"
requests = "^2.32.3"
python-dotenv = "^1.0.1"
beautifulsoup4 = "^4.12.3"
codetiming = "^1.4.0"
tqdm = "^4.66.5"
httpx = "^0.27.2"
ngrok = "^1.4.0"
mutagen = "^1.47.0"
flask = "^3.0.3"
pandas = "^2.2.3"
pyarrow = "^18.0.0"
setuptools = "^75.1.0"
openai = "^1.51.2"
loguru = "^0.7.2"
cronitor = "^4.7.1"
sentry-sdk = "^2.17.0"
ctranslate2 = "<4.5.0" # 4.5.0 requires libraries we don't have
[tool.poetry.group.ml.dependencies]
whisperx = { git = "https://github.com/m-bain/whisperx.git", markers = "sys_platform == 'linux'", rev = "f2da2f858e99e4211fe4f64b5f2938b007827e17" }
torchvision = { version = "^0.18.1", markers = "sys_platform == 'linux'" }
numpy = "<2.0.0"
[tool.poetry.group.stats.dependencies]
ipykernel = "^6.29.5"
pydub = "^0.25.1"
[tool.poetry.group.dev.dependencies]
ruff = "*"
coverage = "*"
pytest = "*"
pytest-icdiff = "*"
pytest-cov = "*"
pytest-randomly = "*"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
[tool.codespell]
skip = "poetry.lock,pyproject.toml"
[tool.coverage]
run.branch = true
run.relative_files = true
run.source = ["transcript_bot"]
xml.output = "cov.xml"
[tool.coverage.report]
show_missing = true
skip_empty = true
omit = []
exclude_also = [
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
"NotImplementedError",
"def __repr__",
"if __name__ == .__main__.:",
]
[tool.pyright]
reportMissingImports = true
reportMissingTypeStubs = false
exclude = ["**/.*", "**/node_modules", "**/__pycache__"]
[tool.pytest]
ignore-glob = [".venv"]
[tool.pytest.ini_options]
addopts = ["--strict-markers"]
markers = []
filterwarnings = []
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
[tool.ruff]
line-length = 120
target-version = "py312"
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN101", # missing-type-self - static analyzers infer the type of self
"ANN102", # missing-type-cls - static analyzers infer the type of cls
"ANN401", # any-type - this is acceptable in some cases
"D105", # undocumented-magic-method - documenting magic methods is redundant
"D107", # undocumented-public-init - documenting init methods is redundant
"DTZ", # flake8-datetimez - we don't always want timezone-aware datetimes
"EM", # flake8-errmsg - tough to enforce
"ERA", # commented-out-code - sometimes commented out code is useful
"FIX002", # errors for todos
"PLR0913", # too many arguments to function (including tests) - should not be a blocker
"PT004", # missing-fixture-name-underscore - adding underscore to names means IDEs will show them as unused
"SIM108", # Ternaries make code harder to read, especially for new developers
"TD", # rules related to TODOs in code
"T20", # makes using print and pprint an error
"TRY003", # warns for long messages when raising exceptions rather than in the class
# These are ignored because we use Ruff to format code.
"COM812",
"E501",
"ISC001",
# Doc rules.
"D100", # public modules (I don't think this is necessary)
]
# Frustrating automatic fixes (ex. removing unused imports before you have a chance to use them)
unfixable = ["B007", "E712", "F401", "F841"]
exclude = [".venv"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
ignore-fully-untyped = true
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
fixture-parentheses = true
parametrize-names-type = "csv"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.lint.flake8-type-checking]
quote-annotations = true
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"sqlalchemy.orm.DeclarativeBase",
]
[tool.ruff.lint.isort]
known-first-party = ["transcript_bot"]
[tool.ruff.lint.per-file-ignores]
# Rules for notebooks:
"*.ipynb" = ["PLE1142", "PLR2004", "S101", "S311"]
# Rules for tests:
"test_*.py" = ["ANN001", "ANN401", "D10", "PGH", "PLR2004", "S101", "SLF"]
# Rules for init files:
"__init__.py" = ["D10"]
# Project-specific rules:
# Each segment type does not need its own docstring.
"episode_segments.py" = [
"D101",
"D102", # public methods (this can be disabled if we can transition to py3.12 and use the override decorator)
]
[tool.ruff.lint.pydocstyle]
convention = "google"