forked from giacomonazzaro/hanagram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
272 lines (242 loc) · 7.06 KB
/
Copy pathpyproject.toml
File metadata and controls
272 lines (242 loc) · 7.06 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
dynamic = ["version"]
name = "hanagram"
description = "Telegram bot to play Hanabi with your friends."
readme = "README.md"
authors = [
{name = "Tsvika Shapira", email = "tsvikas@gmail.com"}
]
keywords = []
classifiers = [
# TODO: remove when ready to upload to pypi
"Private :: Do Not Upload",
# TODO: choose more classifiers from the list in https://pypi.org/classifiers/
# i.e.: Environment, Framework, Intended Audience, Topic
# TODO: update the development status
"Development Status :: 3 - Alpha",
]
# urls.Homepage = "https://hanagram.readthedocs.io"
urls.Source = "https://github.com/tsvikas/hanagram"
urls.Changelog = "https://github.com/tsvikas/hanagram/blob/main/CHANGELOG.md"
# urls.ReleaseNotes = "https://github.com/tsvikas/hanagram/releases"
# urls.Documentation = "https://hanagram.readthedocs.io"
urls.Issues = "https://github.com/tsvikas/hanagram/issues"
# urls.Funding = "https://github.com/sponsors/tsvikas"
# Discussions = "https://github.com/tsvikas/hanagram/discussions"
# telepot import fails for python 3.12
requires-python = ">=3.11, <3.12"
dependencies = [
"pillow>=11.1.0",
"python-dotenv>=1.0.1",
"telepota>=1.0",
]
[project.optional-dependencies]
# optional_name = ["some_package >=1.0"]
[project.scripts]
screenshot = "hanagram.draw:create_screenshot"
play-repl = "hanagram.hanabi:main"
play-telegram = "hanagram.play_telegram:start_telegram_bot"
[project.gui-scripts]
# hanagram = "hanagram.gui:app.run"
[dependency-groups]
dev = [
## used in the justfile
"rust-just ~=1.0",
"prek ~=0.4.0",
"black ~=26.1",
"ruff ~=0.15.0",
## can be used for debug
"icecream >=2",
## can be used for REPL
"ipython >=8",
]
test = [
"pytest ~=9.0",
## running
"pytest-reverse ~=1.0",
"pytest-xdist[psutil] ~=3.0",
## reporting
"pytest-clarity ~=1.0",
"pytest-github-actions-annotate-failures ~=0.4.0",
## extras
"pytest-benchmark ~=5.0",
"pytest-cov ~=7.0",
## fixtures
# "freezegun ~=1.0",
# "hypothesis ~=6.0",
# "pytest-datadir ~=1.0",
# "pytest-mock ~=3.3",
# "pytest-regressions ~=2.0",
]
docs = [
"mkdocs ~=1.0",
"mkdocs-material ~=9.0",
"mkdocstrings-python ~=1.0",
"mkdocs-gen-files ~=0.5.0",
"mkdocs-literate-nav ~=0.6.0",
"mkdocs-section-index ~=0.3.0",
]
typing = [
"mypy ~=2.1.0",
"ty ~=0.0",
# add "*-stubs" and "types-*" packages here (">=0")
]
[tool.uv]
required-version = ">=0.10.12"
default-groups = ["dev", "test", "typing"]
# Minimum age guard: only consider package versions released at least 24h ago,
# as a lightweight supply-chain defense against just-published malicious releases.
exclude-newer = "24 hours"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/hanagram/_version.py"
[tool.pytest]
minversion = "9.0"
testpaths = [
"src/",
"tests/",
]
addopts = [
## collection
"--doctest-modules",
## reporting
"-ra",
## addons: pytest-benchmark
"--benchmark-disable",
## addons: pytest-cov
# this might affect debuggers.
# use `--no-cov` to disable in the debugger
# see https://pytest-cov.readthedocs.io/en/latest/debuggers.html
"--cov=src/hanagram",
"--cov-branch",
## addons: pytest-reverse
"--reverse",
## addons: pytest-xdist
# this enable parallel execution, but hides filenames in output
# "--numprocesses=auto", # pytest-xdist
]
## testing
strict = true
empty_parameter_set_mark = "xfail" # The default value in future releases
filterwarnings = [
"error",
"default::DeprecationWarning",
"error::DeprecationWarning:hanagram",
]
log_level = "INFO"
[tool.coverage]
run.omit = [
"src/hanagram/__main__.py",
"src/hanagram/_version.py",
]
[tool.ty]
src.include = [
"src",
"tests",
]
[tool.mypy]
files = ["src", "tests"]
mypy_path = "stubs"
fixed_format_cache = true
# set the platform
python_version = "3.11"
# enable checks [last updated: mypy 2.1]
strict = true
strict_equality_for_none = true
# telepot is unmaintained and untyped (see comment above on telepota dep),
# so parameters typed as telepot.Bot / InlineKeyboardMarkup unavoidably surface as unimported-Any
disallow_any_unimported = false
warn_unreachable = true
disallow_any_explicit = true
enable_error_code = [
# from https://mypy.readthedocs.io/en/stable/error_code_list2.html
"redundant-self",
"deprecated",
"redundant-expr",
"possibly-undefined",
"truthy-bool",
"truthy-iterable",
"ignore-without-code",
"unused-awaitable",
"explicit-override",
"mutable-override",
"unimported-reveal",
"exhaustive-match",
]
[tool.deptry.per_rule_ignores]
# add dependencies that are not used in the codebase
DEP002 = [
]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
# Use google-style conventions for docstrings
pydocstyle.convention = "google"
# TODO: enable more ruff checks
#select = [
# "ALL",
# # extend rules outside pydocstyle google convention
# "D401", # pydocstyle/non-imperative-mood
# "D404", # pydocstyle/docstring-starts-with-this
#]
ignore = [
# needed only in large codebases
"TD002", # flake8-todos/missing-todo-author
"TD003", # flake8-todos/missing-todo-link
# incompatible with other rules
"COM812", # flake8-commas/missing-trailing-comma (incompatible with black)
# disagree:
"PD010", # pandas-vet/pandas-use-of-dot-pivot-or-unstack
"PD013", # pandas-vet/pandas-use-of-dot-stack
# annoying:
"EM10", # flake8-errmsg/*-in-exception
"RET504", # flake8-return/unnecessary-assign
# ban something useful for a possibly good reason
#"C901", # mccabe/complex-structure
#"S101", # flake8-bandit/assert
#"FIX00", # flake8-fixme/line-contains-*
#"ERA001", # eradicate/commented-out-code
#"PLR091", # PyLint-Refactor/too-many-*
#"TRY003", # tryceratops/raise-vanilla-args
]
# objects that should be treated equivalently to a logging.Logger object.
logger-objects = ["loguru.logger"]
# allow the omission of a return type hint for __init__
flake8-annotations.mypy-init-return = true
# allow `dict(a=1, b=2)`
flake8-comprehensions.allow-dict-calls-with-keyword-arguments = true
# flag modules or module members that may not be imported or accessed
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"collections.namedtuple".msg = "Use typing.NamedTuple or @dataclasses.dataclass(frozen=True, slots=True)"
[tool.ruff.lint.per-file-ignores]
"src/hanagram/cli.py" = [
"T20", # flake8-print
]
"src/hanagram/_version.py" = [
"ALL",
]
"scripts/**.py" = [
"T20", # flake8-print
"INP001", # implicit-namespace-package
]
"!tests/test_*.py" = [
"PT", # flake8-pytest-style
]
"tests/**.py" = [
"INP001", # flake8-no-pep420/implicit-namespace-package
]
"tests/test_*.py" = [
"PLR2004", # PyLint-Refactor/magic-value-comparison
"S101", # flake8-bandit/assert
"D1", # pydocstyle/undocumented-*
"TC001", # flake8-type-checking/typing-only-*-import
"TC002", # flake8-type-checking/typing-only-*-import
"TC003", # flake8-type-checking/typing-only-*-import
]
[tool.pylint]
py-version = "3.11"
ignore-paths = [".*/_version.py"]
reports.output-format = "colorized"