-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
157 lines (139 loc) · 3.55 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
[project]
name = "aoc-cj"
version = "0.1.0"
description = "cj81499's solutions for https://adventofcode.com/"
authors = [
{ name = "Cal Jacobson", email = "[email protected]" },
]
dependencies = [
"advent-of-code-data>=2.0.1",
"more-itertools>=10.1.0",
"numpy>=1.26.2",
"z3-solver>=4.12.4",
"lark>=1.1.8",
"networkx>=3.2.1",
]
requires-python = ">=3.12"
readme = "README.md"
license = { text = "MIT" }
[project.urls]
homepage = "https://github.com/cj81499/advent-of-code"
[project.entry-points."adventofcode.user"]
cj81499 = "aoc_cj:solve"
[tool.uv]
dev-dependencies = [
"ruff>=0.6.2",
"mypy>=1.11.2",
"pytest>=8.3.2",
"pytest-cov>=5.0.0",
"types-networkx>=3.2.1.20240813",
"pre-commit>=3.8.0",
]
[tool.coverage.run]
branch = true
parallel = true
omit = []
[tool.coverage.report]
exclude_also = [
'if __name__ == "__main__":',
'if TYPE_CHECKING:',
'raise NotImplementedError',
'@abc\.abstractmethod',
'assert False',
'assert_never\(.*\)',
]
[tool.ruff]
line-length = 120
target-version = "py38" # FIXME: replace w/ project.requires-python - https://docs.astral.sh/ruff/settings/#target-version
output-format = "grouped"
src = [
"src",
# "test",
]
[tool.ruff.lint]
select = [ # https://docs.astral.sh/ruff/rules/ # TODO: enable additional linter rules
# "F", # Pyflakes
"F401", # unused-import
# "E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
# TODO: evaluate flake8 rules
"ERA",
# "PL", # pylint
# "FURB", #refurb
"RUF", # ruff
]
[tool.pytest.ini_options]
# skip slow tests by default
addopts = "-m 'not slow'"
markers = [
"slow: marks tests as slow",
]
xfail_strict = true
[tool.mypy] # https://mypy.readthedocs.io/en/stable/config_file.html
# Opt out of type checking old years
# TODO: type check tests too
exclude = [
'^tests\/aoc2015\/',
'^src\/aoc_cj\/aoc2015\/',
'^tests\/aoc2016\/',
'^src\/aoc_cj\/aoc2016\/',
'^tests\/aoc2017\/',
'^src\/aoc_cj\/aoc2017\/',
'^tests\/aoc2018\/',
'^src\/aoc_cj\/aoc2018\/',
'^tests\/aoc2019\/',
'^src\/aoc_cj\/aoc2019\/',
'^tests\/aoc2020\/',
'^src\/aoc_cj\/aoc2020\/',
'^tests\/aoc2021\/',
'^src\/aoc_cj\/aoc2020\/',
]
strict = true
# Disallow dynamic typing
disallow_any_unimported = true
disallow_any_decorated = true
disallow_any_generics = true
disallow_subclassing_any = true
# Untyped definitions and calls
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = true
enable_error_code = [ # https://mypy.readthedocs.io/en/stable/error_code_list2.html#error-codes-optional
'redundant-self',
'redundant-expr',
'possibly-undefined',
'truthy-bool',
'truthy-iterable',
'ignore-without-code',
'unused-awaitable',
'unused-ignore',
'explicit-override',
'unimported-reveal',
]
implicit_reexport = true
strict_equality = true
# Configuring error messages
show_column_numbers = true
pretty = true
# Miscellaneous
warn_unused_configs = true
[[tool.mypy.overrides]]
# aocd doesn't provide types https://github.com/wimglenn/advent-of-code-data/issues/78
module = ['aocd']
ignore_missing_imports = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"