File tree Expand file tree Collapse file tree 2 files changed +1
-32
lines changed Expand file tree Collapse file tree 2 files changed +1
-32
lines changed Original file line number Diff line number Diff line change 9
9
- setuptools >= 39.1.0
10
10
"""
11
11
12
- import os
13
12
import pathlib
14
- import shutil
15
13
16
14
import invoke
17
15
40
38
TASK_ROOT_STR = str (TASK_ROOT )
41
39
42
40
43
- # shared function
44
- def rmrf (items , verbose = True ):
45
- """Silently remove a list of directories or files"""
46
- if isinstance (items , str ):
47
- items = [items ]
48
-
49
- for item in items :
50
- if verbose :
51
- print ("Removing {}" .format (item ))
52
- shutil .rmtree (item , ignore_errors = True )
53
- # rmtree doesn't remove bare files
54
- try :
55
- os .remove (item )
56
- except FileNotFoundError :
57
- pass
58
-
59
-
60
41
@invoke .task (pre = [ext_test_tasks .pytest ])
61
42
@invoke .task ()
62
43
def pytest (_ ):
@@ -173,14 +154,3 @@ def format(context):
173
154
174
155
175
156
namespace .add_task (format )
176
-
177
-
178
- @invoke .task ()
179
- def ruff_clean (context ):
180
- """Remove .ruff_cache directory"""
181
- with context .cd (TASK_ROOT_STR ):
182
- dirs = ['.ruff_cache' ]
183
- rmrf (dirs )
184
-
185
-
186
- namespace_clean .add_task (ruff_clean , 'ruff' )
Original file line number Diff line number Diff line change @@ -371,8 +371,7 @@ def format(context):
371
371
def ruff_clean (context ):
372
372
"""Remove .ruff_cache directory"""
373
373
with context .cd (TASK_ROOT_STR ):
374
- dirs = ['.ruff_cache' ]
375
- rmrf (dirs )
374
+ context .run ("ruff clean" )
376
375
377
376
378
377
namespace_clean .add_task (ruff_clean , 'ruff' )
You can’t perform that action at this time.
0 commit comments