-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
198 lines (166 loc) · 5.03 KB
/
pyproject.toml
File metadata and controls
198 lines (166 loc) · 5.03 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "no-guess-dev"
[tool.ruff]
# Ruff configuration for code formatting and linting
line-length = 80
target-version = "py313"
# Exclude directories
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"docs/conf.py",
]
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
# Add other rules as needed:
# - isort (I) for import sorting
# - pyupgrade (UP) for Python version upgrade suggestions
# - flake8-bugbear (B) for common bugs
# - flake8-comprehensions (C4) for comprehension improvements
# - flake8-simplify (SIM) for simplification suggestions
select = [
"E", # pycodestyle errors
"F", # Pyflakes
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"S", # flake8-bandit (security)
]
ignore = [
"E203", # whitespace before ':' (conflicts with black/ruff format)
"B904", # raise from - will be addressed in a future update
]
# Allow autofix for all enabled rules (when `--fix` is provided)
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
# Ignore import rules in __init__.py files
"__init__.py" = ["F401", "F403"]
# Ignore rules in test files
"tests/**/*.py" = ["B", "SIM", "S101", "S105", "S106", "S110"] # S101: assert; S105/S106: credentials; S110: bare except
# Ignore import order in examples (they need to modify sys.path first)
"examples/**/*.py" = ["E402", "S105", "S106"] # S105/S106: example mock credentials
# Ignore assert_used in CLI rich output (acceptable for non-library code)
"src/nwp500/cli/rich_output.py" = ["S101"]
[tool.ruff.lint.isort]
known-first-party = ["nwp500"]
[tool.ruff.format]
# Use double quotes for strings
quote-style = "double"
# Indent with spaces
indent-style = "space"
# Like Black, respect magic trailing commas
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending
line-ending = "auto"
[tool.mypy]
# Enable strict mode for comprehensive type checking
strict = true
# Python version target
python_version = "3.13"
# Module discovery
files = ["src/nwp500", "tests"]
mypy_path = "src"
namespace_packages = true
explicit_package_bases = true
# Import discovery
follow_imports = "normal"
ignore_missing_imports = false
# Platform configuration
platform = "linux"
# Warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
# Error reporting
show_error_context = true
show_column_numbers = true
show_error_codes = true
pretty = true
# Incremental mode
incremental = true
cache_dir = ".mypy_cache"
# Per-module overrides
[[tool.mypy.overrides]]
module = "awscrt.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "awsiot.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "aiohttp.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "click.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "nwp500.cli.*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "pydantic.*"
ignore_missing_imports = true
[tool.pyright]
# Pyright configuration for strict type checking
pythonVersion = "3.13"
typeCheckingMode = "strict"
include = ["src/nwp500", "tests"]
exclude = [".venv", "build", "dist", ".tox"]
# Strict error reporting
reportGeneralTypeIssues = "error"
reportUnboundVariable = "error"
reportUnusedImport = "error"
reportUnsupportedDunderAll = "error"
reportPrivateUsage = "error"
reportConstantRedefinition = "error"
reportOptionalCall = "error"
reportUnnecessaryComparison = "error"
reportPossiblyUnboundVariable = "error"
reportUnnecessaryIsInstance = "error"
reportUnusedVariable = "error"
reportIncompatibleMethodOverride = "error"
reportIncompatibleVariableOverride = "error"
# Type stub warnings
reportMissingTypeStubs = "warning"
reportUnknownParameterType = "warning"
reportUnknownMemberType = "warning"
reportUnknownVariableType = "warning"
reportUnknownArgumentType = "warning"
reportMissingParameterType = "warning"
reportPrivateImportUsage = "warning"
# Untyped decorators and base classes from third-party libraries (Click, Pydantic)
# These libraries don't have complete type stubs, so we report these as warnings
reportUntypedFunctionDecorator = "warning"
reportUntypedBaseClass = "warning"
# Ignore missing imports for external libraries without stubs
reportMissingImports = false