-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
193 lines (174 loc) · 6.52 KB
/
pyproject.toml
File metadata and controls
193 lines (174 loc) · 6.52 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
[project]
name = "st-issues"
version = "0.1.0"
description = "Various tools to help with the Streamlit library development."
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"streamlit[starlette,performance]>=1.56.0",
"pandas",
"numpy",
"plotly",
"altair>=5",
"matplotlib",
"seaborn",
"pydeck",
"streamlit-extras",
"pytz",
"vega-datasets",
"psutil",
"streamlit-folium",
"streamlit-aggrid",
"humanize",
"coverage",
"httpx",
"polars",
"jinja2",
"streamlit-pdf",
"git-fame",
"scipy",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["app"]
# =============================================================================
# UV configuration
# =============================================================================
[tool.uv]
default-groups = ["dev"]
# =============================================================================
# Development dependencies
# =============================================================================
[dependency-groups]
dev = [
"pytest>=9.0.2",
"ruff==0.14.13",
"ty==0.0.12",
"mypy==1.19.1",
"watchdog",
"pandas-stubs",
"pre-commit>=4.5.1",
]
# =============================================================================
# Ruff configuration (linting + formatting)
# =============================================================================
[tool.ruff]
line-length = 120
extend-exclude = [
"issues/**",
"archive/**",
"static/**",
]
[tool.ruff.lint]
preview = true
select = [
"ALL", # All rules
]
ignore = [
# Ignored rule sets:
"DTZ", # Checks for usage of unsafe naive datetime class.
"C90", # Checks for McCabe complexity.
"SLF", # Checks unexpected for private member access.
"BLE", # Checks for blind except statements.
"CPY", # Checks for copyright statement.
"DOC", # Checks for correct docstring format.
"FBT", # Checks for Boolean-typed positional argument in function definition.
# Ignored rules (sorted alphabetically):
"ANN401", # Allow Any type in annotations.
"COM812", # Trailing comma missing. Not recommended with formatter.
"COM819", # Trailing comma prohibited. Not recommended with formatter.
"D100", # Missing docstring in public module.
"D101", # Missing docstring in public class.
"D103", # Missing docstring in public function.
"D104", # Missing docstring in public package.
"D107", # Missing docstring in __init__.
"E501", # Line too long. Ignored for user-facing strings and help text.
"ERA001", # Commented out code.
"FIX002", # Disallow TODO comments.
"FURB152", # Math constants should use math module.
"PLC0415", # Imports not at top-level.
"PLC2701", # Import of private name.
"PLR0904", # Too many public methods.
"PLR0911", # Too many return statements.
"PLR0912", # Too many branches.
"PLR0913", # Too many arguments.
"PLR0914", # Too many local variables.
"PLR0915", # Too many statements.
"PLR0916", # Too many boolean expressions.
"PLR0917", # Too many positional arguments.
"PLR1702", # Too many nested blocks.
"PLR2004", # Magic value used in comparison.
"PLR6301", # Method could be function (no self usage).
"RET504", # Unnecessary assignment before return.
"RUF052", # Dummy variable accessed.
"RUF067", # Non-empty __init__ module.
"SIM117", # Multiple with statements should be combined.
"T201", # Print statement found.
"TD002", # Missing author in TODO.
"TD003", # Missing issue link in TODO.
"TRY300", # Consider else block instead of return in try.
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ANN", # Ignore annotation rules (test functions don't need full typing).
"ARG", # Allow unused arguments (common in test fixtures and mocks).
"D", # Ignore docstring rules (tests are self-documenting via names).
"INP", # Allow implicit namespace packages (test directories).
"N", # Ignore naming conventions (test names can be descriptive/long).
"PERF", # Ignore performance rules (clarity over speed in tests).
"S", # Ignore bandit security rules (test code doesn't need security hardening).
"TRY", # Ignore tryceratops rules (simpler exception handling in tests).
]
extend-safe-fixes = ["TC002", "TC003"]
[tool.ruff.lint.isort]
known-first-party = ["app"]
[tool.ruff.lint.pydocstyle]
# Use the Google style for docstrings.
convention = "google"
[tool.ruff.lint.flake8-unused-arguments]
# Ignore unused variadic argument, like *args and **kwargs.
ignore-variadic-names = true
[tool.ruff.lint.flake8-comprehensions]
# Allow dict calls that make use of keyword arguments (e.g., dict(a=1, b=2)).
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
# =============================================================================
# mypy configuration (type checking)
# =============================================================================
[tool.mypy]
python_version = "3.13"
files = ["app"]
cache_dir = ".mypy_cache"
incremental = true
warn_return_any = false # Don't warn when returning Any from typed function
warn_unused_ignores = false # Don't warn about unused # type: ignore comments
check_untyped_defs = true # Type check inside untyped functions
ignore_missing_imports = true # Silence errors for imports without stubs
disallow_any_generics = false # Allow generic types without type parameters (e.g. List instead of List[int])
disallow_untyped_defs = true # Require type annotations on all functions
disallow_incomplete_defs = true # Require full signatures (no partial annotations)
disable_error_code = ["import-untyped"] # Disable error code for imports without stubs
[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true
# =============================================================================
# ty configuration (type checking)
# =============================================================================
[tool.ty.src]
# Only check the app directory, exclude archive and issues (example files)
include = ["app"]
[tool.ty.rules]
unused-ignore-comment = "ignore" # Allow mypy-compatible ignore comments
# =============================================================================
# pytest configuration
# =============================================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]