audreyfeldroy / cookiecutter-pypackage

Cookiecutter template for a Python package.
BSD 3-Clause "New" or "Revised" License
4.26k stars 1.78k forks source link

Error with the "make clean-build" command #564

Closed williamcanin closed 3 years ago

williamcanin commented 4 years ago

Description

When we activate the virtual machine in the project; we installed the requirements and, we installed the package with "make install", right after that when we are going to do a cleaning with the "make clean" command, an error is obtained in the "clean-build" section of the Makefile file.

What I Did

make clean  
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
rm: unable to remove './venv/lib/python3.8/site-packages/python_boilerplate-0.1.0-py3.8.egg': It is a directory
make: *** [Makefile:36: clean-build] Error 1

This is because in line 6 (find. -name '* .egg' -exec rm -f {} +), the command trying to remove a directory containing "egg" in my virtual machine (venv) folder. Then the error arises because it does not have the "r" flag for removing directories in the command.

My suggestion is to ignore the directory of the virtual machine in the "find" commands, like this:

find . '!' -path './venv/*' -name '*.egg' -exec rm -f {} +
PsiACE commented 4 years ago

Got it, I saw your pr, let's discuss it in #562