@@ -48,10 +48,10 @@ def merge(d1: Any, d2: Any) -> Any: # noqa: D103
48
48
49
49
50
50
def mkdocs_config () -> str : # noqa: D103
51
- from mkdocs import utils
51
+ import mergedeep
52
52
53
- # patch YAML loader to merge arrays
54
- utils .merge = merge
53
+ # force YAML loader to merge arrays
54
+ mergedeep .merge = merge
55
55
56
56
if "+insiders" in pkgversion ("mkdocs-material" ):
57
57
return "mkdocs.insiders.yml"
@@ -103,6 +103,7 @@ def check_quality(ctx: Context) -> None:
103
103
ctx .run (
104
104
ruff .check (* PY_SRC_LIST , config = "config/ruff.toml" ),
105
105
title = pyprefix ("Checking code quality" ),
106
+ command = f"ruff check --config config/ruff.toml { PY_SRC } " ,
106
107
)
107
108
108
109
@@ -120,7 +121,11 @@ def check_dependencies(ctx: Context) -> None:
120
121
allow_overrides = False ,
121
122
)
122
123
123
- ctx .run (safety .check (requirements ), title = "Checking dependencies" )
124
+ ctx .run (
125
+ safety .check (requirements ),
126
+ title = "Checking dependencies" ,
127
+ command = "pdm export -f requirements --without-hashes | safety check --stdin" ,
128
+ )
124
129
125
130
126
131
@duty
@@ -132,7 +137,12 @@ def check_docs(ctx: Context) -> None:
132
137
"""
133
138
Path ("htmlcov" ).mkdir (parents = True , exist_ok = True )
134
139
Path ("htmlcov/index.html" ).touch (exist_ok = True )
135
- ctx .run (mkdocs .build (strict = True , config_file = mkdocs_config ()), title = pyprefix ("Building documentation" ))
140
+ config = mkdocs_config ()
141
+ ctx .run (
142
+ mkdocs .build (strict = True , config_file = config , verbose = True ),
143
+ title = pyprefix ("Building documentation" ),
144
+ command = f"mkdocs build -vsf { config } " ,
145
+ )
136
146
137
147
138
148
@duty
@@ -145,6 +155,7 @@ def check_types(ctx: Context) -> None:
145
155
ctx .run (
146
156
mypy .run (* PY_SRC_LIST , config_file = "config/mypy.ini" ),
147
157
title = pyprefix ("Type-checking" ),
158
+ command = f"mypy --config-file config/mypy.ini { PY_SRC } " ,
148
159
)
149
160
150
161
@@ -159,8 +170,9 @@ def check_api(ctx: Context) -> None:
159
170
160
171
griffe_check = lazy (g_check , name = "griffe.check" )
161
172
ctx .run (
162
- griffe_check ("git_changelog" , search_paths = ["src" ]),
173
+ griffe_check ("git_changelog" , search_paths = ["src" ], color = True ),
163
174
title = "Checking for API breaking changes" ,
175
+ command = "griffe check -ssrc git_changelog" ,
164
176
nofail = True ,
165
177
)
166
178
@@ -276,4 +288,5 @@ def test(ctx: Context, match: str = "") -> None:
276
288
ctx .run (
277
289
pytest .run ("-n" , "auto" , "tests" , config_file = "config/pytest.ini" , select = match , color = "yes" ),
278
290
title = pyprefix ("Running tests" ),
291
+ command = f"pytest -c config/pytest.ini -n auto -k{ match !r} --color=yes tests" ,
279
292
)
0 commit comments