#!/bin/sh -e
#
# pyclean - clean common python cache files

set -ux

# find . -type d -name '__pycache__' -exec rm -rf {} \;
# clean common python cache files.
find "${@:-.}" -type f -name "*.py[co]" -delete
find "${@:-.}" -type d -name "__pycache__" -delete
find "${@:-.}" -depth -type d -name ".mypy_cache" -exec rm -r "{}" +
find "${@:-.}" -depth -type d -name ".pytest_cache" -exec rm -r "{}" +

{
  set +ux
} 2>/dev/null
