When I run
python setup.py sdist
it creates an sdist in my ./dist directory. This includes a \"PROJECT-egg.info\" file in the zip inside
Pythons packaging and build system is broken imho. So there are many hacks and workarounds for things that one would belive work out of the box.
However, the "cleanest" hack I found for deleting the *.egg-info is using the normal clean --all switch along with the egg_info to place the *.egg-info file in a subfolder that will be cleaned by the clean command. Here an example:
In your setup.cfg use something like this:
[egg_info]
egg_base = ./build/lib
where ./build/lib is a folder that clean --all will delete. Then when building your project with setuptools use the clean command with the --all flag, e.g.
python setup.py bdist_wheel clean --all
if you want to build a source bundle as well just make sure to build bdist_wheel before sdist so the build/lib folder exists, e.g.:
python setup.py bdist_wheel sdist clean --all