Skip to content

Commit 90c18e5

Browse files
committed
🔍 improve clean target in Makefile to exclude virtual environment files
1 parent f866335 commit 90c18e5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ all: lint mypy test
4949

5050
.PHONY: clean
5151
clean:
52-
rm -rf `find . -name __pycache__`
53-
rm -f `find . -type f -name '*.py[co]' `
54-
rm -f `find . -type f -name '*~' `
55-
rm -f `find . -type f -name '.*~' `
56-
rm -f `find . -type f -name '*.cpython-*' `
52+
# TODO -> this kinda wipes a lot of stuff in the python environment, maybe we should be more specific
53+
rm -rf `find . -name __pycache__ -not -path "./.venv/*"`
54+
rm -f `find . -type f -name '*.py[co]' -not -path "./.venv/*"`
55+
rm -f `find . -type f -name '*~' -not -path "./.venv/*"`
56+
rm -f `find . -type f -name '.*~' -not -path "./.venv/*"`
57+
rm -f `find . -type f -name '*.cpython-*' -not -path "./.venv/*"`
5758
rm -rf dist
5859
rm -rf build
5960
rm -rf target

0 commit comments

Comments
 (0)