@@ -78,28 +78,68 @@ commands = [
78
78
artifacts = []
79
79
80
80
# >>> Hatch Test Suite <<<
81
- [tool .hatch .envs .test ]
82
- detached = true
81
+ [tool .hatch .envs .hatch-test ]
83
82
extra-dependencies = [
83
+ " pytest-sugar" ,
84
+ " pytest-django" ,
84
85
" playwright" ,
85
- " twisted" ,
86
86
" channels[daphne]>=4.0.0" ,
87
+ " twisted" ,
87
88
" tblib" ,
88
- " whitenoise " , # TODO: Switch to ServeStatic
89
+ " servestatic " ,
89
90
]
91
+ matrix-name-format = " {variable}-{value}"
92
+
93
+ # Django 4.2
94
+ [[tool .hatch .envs .hatch-test .matrix ]]
95
+ python = [" 3.9" , " 3.10" , " 3.11" , " 3.12" ]
96
+ django = [" 4.2" ]
97
+
98
+ # Django 5.0
99
+ [[tool .hatch .envs .hatch-test .matrix ]]
100
+ python = [" 3.10" , " 3.11" , " 3.12" ]
101
+ django = [" 5.0" ]
102
+
103
+ # Django 5.1
104
+ [[tool .hatch .envs .hatch-test .matrix ]]
105
+ python = [" 3.10" , " 3.11" , " 3.12" , " 3.13" ]
106
+ django = [" 5.1" ]
107
+
108
+ [tool .hatch .envs .hatch-test .overrides ]
109
+ matrix.django.dependencies = [
110
+ { if = [
111
+ " 4.2" ,
112
+ ], value = " django~=4.2" },
113
+ { if = [
114
+ " 5.0" ,
115
+ ], value = " django~=5.0" },
116
+ { if = [
117
+ " 5.1" ,
118
+ ], value = " django~=5.1" },
119
+ ]
120
+
121
+ [tool .pytest .ini_options ]
122
+ addopts = """ \
123
+ --strict-config
124
+ --strict-markers
125
+ --reuse-db
126
+ """
127
+ django_find_project = false
128
+ DJANGO_SETTINGS_MODULE = " test_app.settings_single_db"
129
+ pythonpath = [" ." , " tests/" ]
90
130
91
- [tool .hatch .envs .test .scripts ]
92
- python = [
93
- " pip install -e . -U" ,
94
- " playwright install chromium" ,
95
- " cd tests && python manage.py test --noinput --settings='test_app.settings_single_db'" ,
96
- " cd tests && python manage.py test --noinput --settings='test_app.settings_multi_db'" ,
131
+
132
+ # >>> Hatch Django Scripts <<<
133
+ [tool .hatch .envs .django ]
134
+ extra-dependencies = [" channels[daphne]>=4.0.0" , " twisted" , " servestatic" ]
135
+
136
+ [tool .hatch .envs .django .scripts ]
137
+ runserver = [
138
+ " cd tests && python manage.py migrate --noinput && python manage.py runserver" ,
97
139
]
98
- runserver = [" cd tests && python manage.py runserver" ]
99
140
100
141
101
142
# >>> Hatch Documentation Scripts <<<
102
-
103
143
[tool .hatch .envs .docs ]
104
144
template = " docs"
105
145
detached = true
@@ -138,7 +178,6 @@ detached = true
138
178
check = [" cd src/js && bun install && bun run check" ]
139
179
140
180
# >>> Generic Tools <<<
141
-
142
181
[tool .ruff ]
143
182
extend-exclude = [" */migrations/*" , " .venv/*" , " .eggs/*" , " .nox/*" , " build/*" ]
144
183
line-length = 120
@@ -156,9 +195,3 @@ lint.extend-ignore = [
156
195
]
157
196
lint.preview = true
158
197
lint.isort.known-first-party = [" src" , " tests" ]
159
-
160
- [tool .pytest .ini_options ]
161
- addopts = """ \
162
- --strict-config
163
- --strict-markers
164
- """
0 commit comments