Skip to content

Commit ff5c099

Browse files
committed
Added more targets to clean()
1 parent 3fb75da commit ff5c099

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

remove-json-keys/noxfile.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ def deploy_major(session) : bump_major(session) ; build(session) ; publish(sessi
2323

2424
@session
2525
def clean(session):
26-
paths_to_remove = ['dist', 'build']
27-
for path in paths_to_remove:
28-
if Path(path).exists() : shutil.rmtree(path) ; print(f'Removed {path}/')
29-
for item in Path('.').glob('*.egg-info'):
30-
if item.is_dir() : shutil.rmtree(item) ; print(f'Removed {item}/')
26+
for target in ['dist', 'build', '*_cache', '__pycache__', '*.egg-info']:
27+
for path in Path('.').rglob(target):
28+
if path.is_dir() : shutil.rmtree(path) ; print(f'Removed {path}/')
3129
print('Clean complete!')

translate-messages/noxfile.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ def deploy_major(session) : bump_major(session) ; build(session) ; publish(sessi
2323

2424
@session
2525
def clean(session):
26-
paths_to_remove = ['dist', 'build']
27-
for path in paths_to_remove:
28-
if Path(path).exists() : shutil.rmtree(path) ; print(f'Removed {path}/')
29-
for item in Path('.').glob('*.egg-info'):
30-
if item.is_dir() : shutil.rmtree(item) ; print(f'Removed {item}/')
26+
for target in ['dist', 'build', '*_cache', '__pycache__', '*.egg-info']:
27+
for path in Path('.').rglob(target):
28+
if path.is_dir() : shutil.rmtree(path) ; print(f'Removed {path}/')
3129
print('Clean complete!')

0 commit comments

Comments
 (0)