-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
109 lines (99 loc) · 2.61 KB
/
pyproject.toml
File metadata and controls
109 lines (99 loc) · 2.61 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
98
99
100
101
102
103
104
105
106
107
108
109
[tool.pyright]
venvPath = "."
venv = ".venv"
[tool.black]
line-length = 120
target-version = ['py39']
include = '\.pyi?$'
extend-exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"B", # flake8-bugbear
"UP", # pyupgrade
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"B008", # do not perform function calls in argument defaults
"E203", # whitespace before ':'
"N818", # Exception name should end with Error - we have ForceEndSession by design
"UP007", # Use X | Y for type annotations - we support Python 3.9
"B904", # Within except clause, raise exceptions with raise ... from err
"SIM105", # Use contextlib.suppress - keep explicit for clarity
"SIM108", # Use ternary operator - keep explicit for readability
"SIM117", # Use single with statement - keep nested for clarity
"E501", # Line too long - handled by black
]
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.lint.isort]
known-first-party = ["speechmatics"]
force-single-line = true
[tool.mypy]
python_version = "3.9"
explicit_package_bases = true
namespace_packages = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
show_error_codes = true
exclude = ["tests/", "build/", "dist/"]
[[tool.mypy.overrides]]
module = "websockets.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests", "sdk/speechmatics/*/tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
]
[tool.coverage.run]
source = ["sdk/speechmatics"]
branch = true
omit = ["*/tests/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
show_missing = true
precision = 2