forked from randovania/randovania
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
407 lines (364 loc) · 10.8 KB
/
pyproject.toml
File metadata and controls
407 lines (364 loc) · 10.8 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm>=8",
"wheel>=0.37.0",
"dulwich",
"randovania-scm-version-schema",
"cython",
]
build-backend = "setuptools.build_meta"
[project]
name = "randovania"
authors = [
{name = "Henrique Gemignani Passos Lima"},
]
description = "A randomizer platform for a multitude of games."
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Topic :: Games/Entertainment",
]
requires-python = ">=3.12"
license = "GPL-3.0-or-later"
dynamic = ["version"]
dependencies = [
# server communication, binary version of logic db
"construct",
# Default name for exporting presets
"python-slugify",
# permalinks
"bitstruct",
# obfuscator, guest login, server code
"cryptography",
# Generator
"networkx",
"tenacity>=7.0.0",
# faster than networkx, but not as comprehensive
"rustworkx>=0.17.1",
# server communication
"python-socketio[asyncio_client]",
"aiohttp>=3.9.3",
# nonblocking file IO
"aiofiles",
# Immutable dicts, used in many places
"frozendict",
# Versioning presets
"dulwich>=0.24.6", # Older versions have an issue on windows when using ProcessPoolExecutor
# error reports
"sentry-sdk",
# Patch GamesPatches JSON from rdvgame
"json-delta",
# For the Version class
"packaging",
# For TypeVar default
"typing-extensions>=4.4.0",
# For compressing preset/rdvgames
"zstandard",
# For consistent HTTPS certificate availability across platforms
"certifi",
# speedup GraphRequirement
"cython",
]
[project.optional-dependencies]
exporters = [
# AM2R
"am2r-yams==2.8.4",
# Cave Story
"cave-story-randomizer==2.4.2",
"tsc-utils>=0.2.5",
# Factorio
"factorio-randovania-mod==0.8.1",
# Metroid Dread
"open-dread-rando==2.18.0",
# Metroid Fusion
"mars-patcher==0.10.0",
# Metroid Planets
"planets-yapr==1.0.1",
# Metroid Prime 1
"py_randomprime==1.30.3",
"random-enemy-attributes==1.0.4.3",
# Metroid Prime 1/2
"ppc-asm>=1.2.1", # for multiworld
"open-prime-rando==0.15.1", # but also for echoes exporting
"retro-data-structures>=0.24.0,<0.29", # Newer versions break asset conversion and needs adjusting
# Metroid Prime 2
"mp2hudcolor==1.0.13",
# Metroid: Samus Returns
"open-samus-returns-rando==3.4.0",
]
gui = [
"PySide6-Essentials==6.10.0",
"pyqtdarktheme-fork>=2.3.0",
"markdown",
"qasync",
"natsort",
"appdirs",
# Minimum version compatible with PySide 6.4. 3.6 is also needed for Python 3.11
"matplotlib>=3.6.2",
"humanize", # formatting dates
"nod>=1.9",
"async-wiiload",
"dolphin-memory-engine>=1.0.2",
"pid>=3.0.0",
"qrcode[pil]>=8.0",
]
server = [
"fastapi", # REST server
"jinja2", # templating
"uvicorn[standard]", # server runner
"itsdangerous", # for starlette SessionMiddleware
"python-multipart", # for Form data
"fastapi-socketio-handler>=0.4.0", # socketio server
# monitoring
"sentry-sdk[fastapi]>=2.35.0",
"prometheus-fastapi-instrumentator",
# discord auth
"aiocache", # for fastapi_discord copy
"oauthlib",
"pyjwt<2.11.0",
# database
"peewee",
"cachetools", # for TTLCache
# discord bot
"py-cord>=2.3.1,<2.7", # for randovania/discord_bot; 2.3.1+ is needed for Python 3.11, 2.7 breaks tests
"audioop-lts; python_version>='3.13'", # for py-cord
"Pillow>=9.0.0", # for randovania/discord_bot/database_command
"graphviz", # for randovania/discord_bot/database_command
]
test = [
"pytest",
"pytest-cov",
"pytest-qt",
"pytest-asyncio<1.0.0", # Breaks our tests somehow
"pytest-mock",
"pytest-localftpserver",
"pytest-xdist[psutil]",
"pytest-codspeed",
"pytest-test-groups>=1.2.1",
"httpx", # for server testing
]
website = [
"htmlmin2",
"ruamel.yaml",
]
[dependency-groups]
installer = [
"pyinstaller",
"pyinstaller-hooks-contrib",
"delocate",
]
typing = [
"mypy<1.19.2",
"types-aiofiles",
"types-peewee",
"types-qrcode>=8.0.0.20241004",
"python-socketio-stubs",
"types-oauthlib",
"types-cachetools",
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.urls]
Homepage = "https://github.com/randovania/randovania"
[project.entry-points.console_scripts]
randovania = "randovania.__main__:main"
[tool.setuptools.packages.find]
include = ["randovania*"]
[tool.setuptools.package-data]
"randovania.data" = ["README.md"]
[tool.setuptools_scm]
local_scheme = "no-local-version"
version_file = "randovania/version.py"
version_scheme = "randovania_scm_version_schema:version_scheme"
scm.git.describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"v[0-9]*",
]
[tool.ruff]
line-length = 120
extend-exclude = [
"*_ui.py",
]
[tool.ruff.lint]
select = [
"E", "F", "W", "C90", "I", "UP", "C4",
"RSE",
"TCH",
"PTH",
"COM818", "COM819",
"ISC",
"PIE",
"PT",
"PLC",
"PLC0208", # iterating over set is also not deterministic, so we shouldn't do that!
"PLE",
"PLR0402", "PLR1711", "PLR1722", "PLR0206",
"PLR0133", "PLR0124",
"PLW",
"SIM101",
]
ignore = [
"ISC001", # may cause conflicts with formatter
"PLW0603", # we use some globals here and there
"PLW2901", # TODO: should actually fix these
"PLC0415", # we explicitly use the import within a function to postpone the loading of a module
]
[tool.ruff.lint.isort]
# This is very desirable, but causes issues with py-cord and some usages of construct_pack.encode
# required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 25.
# Defaults to 10, but we're being very flexible right now
max-complexity = 25
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"randovania.bitpacking.bitpacking.BitPackDataclass",
"randovania.bitpacking.type_enforcement.DataclassPostInitTypeCheck",
"randovania.bitpacking.json_dataclass.JsonDataclass",
"randovania.layout.base.base_configuration.BaseConfiguration",
"randovania.exporter.game_exporter.GameExportParams",
"randovania.game_description.pickup.pickup_definition.base_pickup.BasePickupDefinition",
]
runtime-evaluated-decorators = [
"fastapi.FastAPI.get",
"fastapi.FastAPI.post",
"fastapi.FastAPI.put",
"fastapi.FastAPI.patch",
"fastapi.FastAPI.delete",
"fastapi.APIRouter.get",
"fastapi.APIRouter.post",
"fastapi.APIRouter.put",
"fastapi.APIRouter.patch",
"fastapi.APIRouter.delete",
]
[tool.mypy]
files = [
"randovania/bitpacking/",
"randovania/cli/",
"randovania/discord_bot/preset_lookup.py",
"randovania/exporter/",
"randovania/game_connection/",
"randovania/game_description/",
"randovania/game/",
"randovania/games/am2r/generator/",
"randovania/games/am2r/gui/",
"randovania/games/am2r/layout/",
"randovania/games/blank/",
"randovania/games/cave_story/",
"randovania/games/dread/exporter/hint_namer.py",
"randovania/games/dread/gui/",
"randovania/games/fusion/",
"randovania/games/prime_hunters/",
"randovania/games/prime1/",
"randovania/games/prime2/",
"randovania/games/samus_returns/",
"randovania/generator/",
"randovania/graph/",
"randovania/gui/async_race_room_window.py",
"randovania/gui/data_editor.py",
"randovania/gui/game_specific_gui.py",
"randovania/gui/main_online_interaction.py",
"randovania/gui/tracker_window.py",
"randovania/gui/dialog/async_race_admin_dialog.py",
"randovania/gui/dialog/async_race_creation_dialog.py",
"randovania/gui/dialog/async_race_settings_dialog.py",
"randovania/gui/dialog/base_cosmetic_patches_dialog.py",
"randovania/gui/dialog/connections_editor.py",
"randovania/gui/dialog/connector_prompt_dialog.py",
"randovania/gui/dialog/login_prompt_dialog.py",
"randovania/gui/docks/resource_database_editor.py",
"randovania/gui/lib/connections_visualizer.py",
"randovania/gui/lib/editable_table_model.py",
"randovania/gui/lib/faq_lib.py",
"randovania/gui/lib/hints_text.py",
"randovania/gui/lib/pixmap_lib.py",
"randovania/gui/lib/signal_handling.py",
"randovania/gui/preset_settings/hints_tab.py",
"randovania/gui/preset_settings/trick_level_tab.py",
"randovania/gui/widgets/async_race_room_settings_widget.py",
"randovania/gui/widgets/data_editor_canvas.py",
"randovania/gui/widgets/game_connection_window.py",
"randovania/gui/widgets/game_validator_widget.py",
"randovania/gui/widgets/node_selector_widget.py",
"randovania/gui/widgets/tracker_item_image.py",
"randovania/gui/widgets/tracker_map.py",
"randovania/layout/",
"randovania/lib/",
"randovania/resolver/",
"randovania/server/",
"test/bitpacking/",
"test/game_connection",
"test/game_description/",
"test/games/blank/",
"test/games/cave_story/",
"test/games/dread/",
"test/games/prime1/gui/dialog/test_prime_cosmetic_patches_dialog.py",
"test/games/prime2/",
"test/games/samus_returns/",
"test/games/test_game.py",
"test/games/test_hashes.py",
"test/games/test_prime_binary_decoder.py",
"test/generator/",
"test/graph/",
"test/gui/dialog/test_connections_editor.py",
"test/gui/widgets/test_node_selector_widget.py",
"test/lib/",
"test/resolver/test_logging.py",
]
follow_imports = "silent"
disallow_untyped_defs = true
local_partial_types = true
warn_unused_ignores = true
enable_error_code = [
"ignore-without-code",
]
[[tool.mypy.overrides]]
module = "test.*"
disallow_untyped_defs = false
check_untyped_defs = true
disable_error_code = [
"method-assign",
]
[[tool.mypy.overrides]]
module = "randovania.*.gui.generated.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
# any dependencies which we do not control but are missing types go here
# not too much can be done about these, so they're not the end of the world
# dependencies we DO control should use `type: ignore[import-untyped]`
module = [
"bitstruct.*",
"construct.*",
"graphviz.*",
"htmlmin.*",
"json_delta.*",
"networkx.*",
"pid.*",
"pytest_localftpserver.*",
"pytestqt.*",
"qasync.*",
"ruamel.*",
"aiocache.*",
"socketio_handler.*",
]
ignore_missing_imports = true
[tool.uv]
cache-keys = [
{ git = { commit = true, tags = true } },
{ file = "pyproject.toml" },
{ file = "setup.py" },
{ file = "README.md" },
{ file = "randovania/enable-cython" },
]