-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
204 lines (184 loc) · 7.64 KB
/
pyproject.toml
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
[build-system]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"
[project]
authors = [
{name = "JackAshwell11", email = "[email protected]"}
]
dependencies = ["arcade==3.0.0.dev39"]
description = "A procedurally generated bullet bullet-hell dungeon crawler made in Python."
license = {file = "LICENSE"}
name = "hades"
readme = "README.md"
requires-python = ">=3.11"
version = "0.1.0"
[project.urls]
Homepage = "https://github.com/JackAshwell11/Hades"
Repository = "https://github.com/JackAshwell11/Hades"
[tool.black]
preview = true
target_version = ["py312"]
[tool.coverage.paths]
source = [
"src", # Run coverage on the entire project
".nox/*/Lib/site-packages", # Make sure the project is being covered on Windows
".nox/*/lib/*/site-packages", # Make sure the project is being covered on Linux
]
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:", # Exclude all type checking imports
"pragma: no cover", # Exclude all no cover blocks
"raise NotImplementedError", # Exclude all base functions
"if __name__ == .__main__.:", # Exclude script definitions
]
omit = [
"noxfile.py", # Noxfile.py is only used for running the tests and building the project
"*/__main__.py", # This is only used for running the game via the CLI
]
precision = 2
show_missing = true
[tool.coverage.run]
branch = true
source = ["hades"]
# TODO: Review this configuration
[tool.mypy]
disallow_any_decorated = true
disallow_any_explicit = true
#disallow_any_expr = true
#disallow_any_unimported = true
disallow_untyped_calls = false
ignore_missing_imports = true
pretty = true
python_version = "3.12"
show_column_numbers = true
show_error_code_links = true
show_error_context = true
show_error_end = true
strict = true
warn_unreachable = true
warn_unused_configs = true
[tool.pylint."BASIC"]
good-names = "i,j,k,x,y,a,b,dx,dy,x1,x2,y1,y2"
[tool.pylint."FORMAT"]
max-line-length = 88
[tool.pylint."MASTER"]
load-plugins = [
"pylint.extensions.bad_builtin", # Disallow bad docstrings
"pylint.extensions.docstyle", # Disallow bad docstrings
"pylint.extensions.dunder", # Disallow bad typing
"pylint.extensions.while_used", # Disallow broad try clauses
"pylint.extensions.check_elif", # Disallow code that reduces code consistency
"pylint.extensions.comparison_placement", # Disallow empty comments
"pylint.extensions.eq_without_hash", # Disallow implementing __eq__ without __hash__
"pylint.extensions.for_any_all", # Disallow methods which don't use their bound instance
"pylint.extensions.overlapping_exceptions", # Disallow mispelled dunder methods
"pylint.extensions.empty_comment", # Disallow mutating a dictionary during initialisation
"pylint.extensions.docparams", # Disallow not using sets for membership tests
"pylint.extensions.typing", # Disallow overlapping exceptions
"pylint.extensions.private_import", # Disallow placing an elif after an indented block (could be hard to understand)
"pylint.extensions.consider_refactoring_into_while_condition", # Disallow placing the constant on the left of the comparison
"pylint.extensions.confusing_elif", # Disallow private imports
"pylint.extensions.redefined_loop_name", # Disallow redefining loop variables
"pylint.extensions.redefined_variable_type", # Disallow redefining variable types
"pylint.extensions.set_membership", # Disallow spreading multiple assignment statements across if/else blocks
"pylint.extensions.dict_init_mutate", # Disallow the use of deprecated builtin functions
"pylint.extensions.broad_try_clause", # Disallow the use of following an else statement with an if
"pylint.extensions.code_style", # Disallow using a for loop to check for a condition and return a bool
"pylint.extensions.magic_value", # Disallow using a while loop with a condition that can be refactored into the while loop
"pylint.extensions.consider_ternary_expression", # Disallow using magic values
"pylint.extensions.no_self_use", # Disallow using while loops
]
[tool.pylint."MESSAGES CONTROL"]
enable = [
"bad-inline-option", # Disallow badly formatted options
"deprecated-pragma", # Disallow deprecated pragrams for renamed options
"file-ignored", # Disallow messages to inform that files won't be checked
"use-symbolic-message-instead", # Disallow messages enabled/disabled by ID
"useless-suppression", # Disallow disabled messages when they aren't triggered
"prefer-typing-namedtuple", # Enforce typing.NamedTuple over collections.namedtuple
]
include-naming-hint = true
disable = [
"abstract-method", # Allow abstract methods (they are used in Arcade)
"fixme", # Allow using fixme/todo comments
"import-error", # Sometimes pylint can't import a package correctly
"magic-value-comparison", # Stop Pylint complaining about the tests
"not-an-iterable", # Stop Pylint complaining about not being able to iterate over a tuple
"no-name-in-module", # Pylint can't infer imports from the extensions
"too-few-public-methods", # Stop Pylint complaining about too few public methods
"too-many-instance-attributes", # Stop Pylint complaining about too many instance attributes
"too-many-lines", # Stop Pylint complaining about too many lines in a file
"unpacking-non-sequence", # Stop Pylint complaining about unpacking tuples
]
[tool.pytest.ini_options]
addopts = "-vv -ra --showlocals --cov --cov-report term-missing"
pythonpath = ["src"]
testpaths = ["tests"]
[tool.ruff]
extend-exclude = ["src/hades_extensions/vcpkg"]
output-format = "full"
preview = true
show-fixes = true
src = ["src"]
[tool.ruff.lint]
extend-ignore = [
"CPY001", # Allow not having copyright headers in every file
"FIX002", # Allow not having a todo in every file
"S311", # Allow use of the random library
"S404", # Allow use of the subprocess library
"TD002", # Allow not having an author for each todo
"TD003", # Allow not having an issue link for each todo
]
select = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"noxfile.py" = [
"S603", # Ignore flake8-bandit subprocess with shell=True rule
"S607", # Ignore flake8-bandit start process with a partial path rule
"T201", # Ignore flake8-print print rule
]
"*test_*" = [
"PLR2004", # Ignore pylint-refactor magic number rule for the tests
"S101", # Ignore flake8-bandit assert rule for the tests
]
"hades_extensions/*.pyi" = [
"D100", # Ignore pydocstyle module docstring rule
"D101", # Ignore pydocstyle class docstring rule
"D103", # Ignore pydocstyle method docstring rule
"PIE796", # Ignore flake8-pie duplicate enum values rule
]
"src/hades/views/game.py" = [
# TODO: Remove this once event handling has been moved to C++
"C901", # Ignore pylint-complexity rule for the game class
]
"src/hades/views/start_menu.py" = [
"PLR6301", # Ignore pylint no-self-use rule for the start menu event handlers
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.scikit-build]
cmake.source-dir = "src/hades_extensions"
[[tool.scikit-build.overrides]]
if.platform-system = "^win32"
cmake.args = ["-GNinja", "-DDO_TESTS=OFF", "--preset WinRelease"]
[[tool.scikit-build.overrides]]
if.platform-system = "^linux"
cmake.args = ["-GNinja", "-DDO_TESTS=OFF", "--preset LinuxRelease"]
[tool.uv]
dev-dependencies = [
"black==24.10.0",
"mypy==1.13.0",
"nox==2024.10.9",
"nuitka==2.5.6",
"ordered-set==4.1.0",
"pre-commit==4.0.1",
"pylint==3.3.2",
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-icdiff==0.9",
"pytest-instafail==0.5.0",
"pytest-randomly==3.16.0",
"pytest-sugar==1.0.0",
"ruff==0.8.3",
"ssort==v0.14.0",
]
prerelease = "allow"