-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
136 lines (119 loc) · 3.14 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
[project]
name = "zakuchess"
version = "0.1.0"
description = "A daily chess challenge, where pieces are heroic-fantasy characters."
license = { text = "GPL-3.0-or-later" }
authors = [
{name = "Olivier Philippon", email = "olivier@dunsap.com"},
]
readme = "README.md"
requires-python = ">=3.11"
dependencies= [
"Django==5.1.*",
# Django doesn't follow SemVer, so we need to specify the minor version
"gunicorn==22.*",
"django-alive==1.*",
"chess==1.*",
"django-htmx==1.*",
"dominate==2.*",
"dj-database-url==2.*",
"requests==2.*",
"django-axes[ipware]==6.*",
"whitenoise==6.*",
"django-import-export==3.*",
"msgspec==0.18.*",
"zakuchess",
]
[project.optional-dependencies]
dev = [
"python-dotenv==1.*",
"ruff==0.6.*",
"mypy==1.*",
"pre-commit==3.*",
"ipython==8.*",
"types-requests==2.*",
"django-extensions==3.*",
# (httpx is only used in "scripts/download_assets.py" for parallel downloads)
"httpx==0.26.*",
"sqlite-utils==3.*",
]
test = [
"pytest==7.*",
"pytest-django==4.*",
"pytest-cov==4.*",
"time-machine==2.*",
]
load-testing = [
"locust==2.*",
]
[project.urls]
Website = "https://zakuchess.com"
Repository = "https://github.com/olivierphi/zakuchess"
[tool.uv]
package = true # symlinks the project's "src/" root folder to the venv
[tool.ruff]
# @link https://docs.astral.sh/ruff/configuration/
target-version = "py311"
exclude = [
"src/project/settings",
]
[tool.ruff.lint]
ignore = ["E501"]
select = [
"F", # flake8
"I", # isort
# https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TCH001",
"TCH002",
"TCH003",
]
[tool.ruff.lint.per-file-ignores]
"src/project/settings/*" = ["F405"]
"src/lib/chess_engines/sunfish/sunfish.py" = ["F841", "F821"]
[tool.ruff.lint.isort]
# https://docs.astral.sh/ruff/settings/#lintisort
combine-as-imports = true
known-first-party = ["apps", "lib", "project"]
[tool.ruff.lint.flake8-type-checking]
# https://docs.astral.sh/ruff/settings/#lintflake8-type-checking
quote-annotations = true
strict = true
runtime-evaluated-base-classes = ["msgspec.Struct"]
[tool.mypy]
# @link https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml
python_version = "3.11"
mypy_path = "src/"
exclude = [
'^src/project/settings/.*\.py$',
'^src/apps/[^/]+/migrations/.*\.py$',
'^src/lib/chess_engines/[^/]+/.*\.py$',
'^locustfile\.py$',
'^scripts/load_testing/*\.py$',
]
[[tool.mypy.overrides]]
module = [
"django.*",
"dominate.*",
"import_export.*",
"time_machine.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
pythonpath = "src"
testpaths = [
"src/apps/*/tests/",
"src/project/tests/",
]
python_files = ["test_*.py"]
addopts = "--reuse-db"
DJANGO_SETTINGS_MODULE = "project.settings.test"
[tool.coverage.run]
# @link https://coverage.readthedocs.io/en/latest/excluding.html
# @link https://coverage.readthedocs.io/en/latest/source.html
omit = [
# omit tests themselves from the coverage measure:
"src/apps/*/tests/**/*.py",
"src/project/tests/**/*.py",
# also exclude Django settings:
"src/project/settings/*.py",
]