-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
206 lines (189 loc) · 6.36 KB
/
Copy pathpyproject.toml
File metadata and controls
206 lines (189 loc) · 6.36 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
199
200
201
202
203
204
205
206
[project]
name = "innverse-stats"
version = "0.1.0"
description = "Analytics app for The Wandering Inn"
readme = "README.md"
authors = [
{name = "Cameron Blankenbuehler", email = "cameron.blankenbuehler@protonmail.com"},
]
license = {text = "MIT"}
requires-python = "<4.0,>=3.12"
dependencies = [
"beautifulsoup4<5.0.0,>=4.12.2",
"certifi<2025.0.0,>=2024.07.04",
"charset-normalizer<4.0.0,>=3.2.0",
"django<7.0.0,>=6.0.4",
"django-browser-reload>=1.20.0,<2.0.0",
"django-debug-toolbar<5.0.0,>=4.3.0",
"django-htmx<2.0.0,>=1.17.2",
"django-tables2>=2.7,<3.0",
"django-tailwind<5.0.0,>=4.0.0",
"djangorestframework<4.0.0,>=3.14.0",
"fake-useragent<2.0.0,>=1.1.3",
"gunicorn<24.0.0,>=23.0.0",
"idna<4.0,>=3.4",
"kaleido==0.2.1",
"pandas<3.0.0,>=2.0.3",
"pandas-stubs<3.0.0.0,>=2.1.4.231218",
"plotly<6.0.0,>=5.14.1",
# NOTE: psycopg seems to require the clang compiler for some reason
# install with `CC=clang uv sync`
"psycopg[c,pool]<4.0,>=3.3",
"pygobject<4.0.0,>=3.44.1",
"pymemcache<5.0.0,>=4.0.0",
"pysocks<2.0.0,>=1.7.1",
"python-dotenv<2.0.0,>=1.0.0",
"regex<2024.0.0,>=2023.12.25",
"requests<3.0.0,>=2.32.3",
"scipy<2.0.0,>=1.12.0",
"soupsieve<3.0.0,>=2.4.1",
"tablib<4.0.0,>=3.5.0",
"urllib3<3.0,>=2.5.0",
"uvicorn<1.0.0,>=0.26.0",
"wikitextparser<1.0.0,>=0.55.13",
"pip<27.0.0,>=26.0",
"django-minify-html>=1.13.0",
"minify-html<=0.15.0",
"django-watchfiles>=1.4.0",
"aiosmtpd>=1.4.6",
]
[dependency-groups]
dev = [
"django-debug-toolbar-template-profiler<3.0.0,>=2.1.0",
"django-pattern-library<2.0.0,>=1.0.0",
"django-stubs[compatible-mypy]<6.0.0,>=5.0.4",
"ipdb==0.13.13",
"ipython<9.0.0,>=8.14.0",
"mypy<2.0.0,>=1.7.1",
"pre-commit<4.0.0,>=3.3.3",
"pyflame<1.0.0,>=0.3.1",
"pylsp-mypy<1.0.0,>=0.6.8",
"statsmodels<1.0.0,>=0.14.0",
"types-regex<2024.0.0.0,>=2023.12.25.20240311",
"djangorestframework-stubs[compatible-mypy]<4.0.0,>=3.14.5",
"pywikibot<10.0.0,>=9.1.3",
"pytest<9.0.0,>=8.2.2",
"pytest-django>=4.8.0,<5.0.0",
"djlint<2.0.0,>=1.35.2",
"poethepoet>=0.35.0",
"ruff>=0.12.8",
"djade>=1.4.0",
"django-extensions>=4.1",
"werkzeug>=3.1.3",
"django-template-lsp>=1.2.1",
]
[tool.uv.extra-build-dependencies]
pygobject = ["meson-python"]
[tool.ruff]
# See https://docs.astral.sh/ruff/settings/#exclude for default excludes
extend-exclude = [
"data",
"site-packages",
"uv.lock",
"**/migrations",
]
line-length = 120
indent-width = 4
[tool.ruff.lint]
# See https://docs.astral.sh/ruff/settings/#lint_select for default lint rules
# See https://docs.astral.sh/ruff/rules/ for all lint rules
extend-select = [
"A", # flake8-builtins rules for shadowed builtin var, functions, etc.
"ARG", # flake8-unused-arguments
"ANN", # flake8-annotations for missing type annotations
"ASYNC",# flake8-async rules for asyncio
"B", # flake8-bugbear rules for likely bugs or design problems
"BLE", # flake8-blind-except for bare Exception or BaseException(s)
"C4", # flake8-comprehensions rules
"COM", # flake8-commas rules for trailing commas
"DJ", # flake8-django detects bad practices in Django projects
"DTZ", # flake8-datetimez check for naive datetimess
"E",
"EM", # flake8-errmsg consistent exception error message formatting
"EXE", # flake8-executable check for correct shebang and permissions
"G", # flake8-logging-format don't use format strings in logging messages
"I", # isort sorted and missing imports
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420 to avoid implicit namespace packages
"ISC", # flake8-implicit-str-concat use implicit string concatenation over multiple lines
"LOG", # flake8-logging check for errors using standard logging module
"PIE",
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib use pathlib instead of os equivalents
"Q", # flake8-quotes for consistent quotes
"RET", # flake8-return
"S", # flake8-bandit security rules
"SIM", # flake8-simplify simplifies common expression and control flow
"T10", # flake8-debugger check for debugger calls and imports
]
ignore = [
"COM812",
"E501",
"E731",
"F405",
"S311",
"S603",
]
unfixable = [ ]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"**/*-example.py" = ["ALL"]
"**/wikibot/*" = ["S105"]
"**/{tests}/*" = ["S101", "ANN001", "ANN201", "ANN202"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pylsp-mypy]
enabled = true
live_mode = true
strict = true
[tool.mypy]
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
disable_error_code = ["import-untyped"]
[[tool.mypy.overrides]]
# Ignore charts mypy errors because Plotly doesn't currently support typing
# Though there is an existing issue see (https://github.com/plotly/plotly.py/issues/1103)
module = [
'stats.charts.*',
]
ignore_missing_imports = true
ignore_errors = true
[tool.django-stubs]
django_settings_module = "innverse.settings"
strict_settings = false
[tool.ipdb]
context=5
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "innverse.settings"
filterwarnings = [
"ignore::UserWarning",
]
testpaths = [
"innverse",
"processing",
"stats",
"stats/wikibot/tests",
]
addopts = "-s --pdbcls=IPython.terminal.debugger:TerminalPdb"
[tool.poe]
executor.type = "uv"
[tool.poe.tasks]
build-chapters.cmd = "python manage.py build --skip-wiki-all --skip-colors --skip-text-refs ./data"
build-wiki.cmd = "python manage.py build --skip-colors --skip-text-refs ./data"
build-textrefs.cmd = "python manage.py build --skip-colors --skip-wiki-all ./data"
collectstatic = "python manage.py collectstatic"
gen-thumbnails.cmd = "python manage.py generate_chart_thumbnails"
makemigrations.cmd = "python manage.py makemigrations"
migrate.cmd = "python manage.py migrate stats"
run-dev.cmd = "python manage.py runserver_plus 9999"
run-prod.cmd = "python -m gunicorn innverse.asgi:application -k uvicorn.workers.UvicornWorker"
serve-static.cmd = "python -m http.server 8080 -d /tmp/twi-stats/"
tailwind-start.cmd = "python manage.py tailwind start"
install.shell = "uv sync && npm install"
format.shell = "ruff format && shopt -s globstar && djade innverse/**/*.html && npx stylelint -f verbose --fix theme/static_src/src/**/*.css"
test = "pytest"