@@ -53,10 +53,10 @@ def merge(d1: Any, d2: Any) -> Any: # noqa: D103
5353
5454
5555def mkdocs_config () -> str : # noqa: D103
56- from mkdocs import utils
56+ import mergedeep
5757
58- # patch YAML loader to merge arrays
59- utils .merge = merge
58+ # force YAML loader to merge arrays
59+ mergedeep .merge = merge
6060
6161 if "+insiders" in pkgversion ("mkdocs-material" ):
6262 return "mkdocs.insiders.yml"
@@ -108,6 +108,7 @@ def check_quality(ctx: Context) -> None:
108108 ctx .run (
109109 ruff .check (* PY_SRC_LIST , config = "config/ruff.toml" ),
110110 title = pyprefix ("Checking code quality" ),
111+ command = f"ruff check --config config/ruff.toml { PY_SRC } " ,
111112 )
112113
113114
@@ -125,7 +126,11 @@ def check_dependencies(ctx: Context) -> None:
125126 allow_overrides = False ,
126127 )
127128
128- ctx .run (safety .check (requirements ), title = "Checking dependencies" )
129+ ctx .run (
130+ safety .check (requirements ),
131+ title = "Checking dependencies" ,
132+ command = "pdm export -f requirements --without-hashes | safety check --stdin" ,
133+ )
129134
130135
131136@duty
@@ -137,7 +142,12 @@ def check_docs(ctx: Context) -> None:
137142 """
138143 Path ("htmlcov" ).mkdir (parents = True , exist_ok = True )
139144 Path ("htmlcov/index.html" ).touch (exist_ok = True )
140- ctx .run (mkdocs .build (strict = True , config_file = mkdocs_config ()), title = pyprefix ("Building documentation" ))
145+ config = mkdocs_config ()
146+ ctx .run (
147+ mkdocs .build (strict = True , config_file = config , verbose = True ),
148+ title = pyprefix ("Building documentation" ),
149+ command = f"mkdocs build -vsf { config } " ,
150+ )
141151
142152
143153@duty
@@ -150,6 +160,7 @@ def check_types(ctx: Context) -> None:
150160 ctx .run (
151161 mypy .run (* PY_SRC_LIST , config_file = "config/mypy.ini" ),
152162 title = pyprefix ("Type-checking" ),
163+ command = f"mypy --config-file config/mypy.ini { PY_SRC } " ,
153164 )
154165
155166
@@ -164,8 +175,9 @@ def check_api(ctx: Context) -> None:
164175
165176 griffe_check = lazy (g_check , name = "griffe.check" )
166177 ctx .run (
167- griffe_check ("mkdocs_autorefs" , search_paths = ["src" ]),
178+ griffe_check ("mkdocs_autorefs" , search_paths = ["src" ], color = True ),
168179 title = "Checking for API breaking changes" ,
180+ command = "griffe check -ssrc mkdocs_autorefs" ,
169181 nofail = True ,
170182 )
171183
@@ -281,4 +293,5 @@ def test(ctx: Context, match: str = "") -> None:
281293 ctx .run (
282294 pytest .run ("-n" , "auto" , "tests" , config_file = "config/pytest.ini" , select = match , color = "yes" ),
283295 title = pyprefix ("Running tests" ),
296+ command = f"pytest -c config/pytest.ini -n auto -k{ match !r} --color=yes tests" ,
284297 )
0 commit comments