Setuptools: clean --all should delete autogenerated <package>.egg-info directory

Created on 21 Nov 2013  路  1Comment  路  Source: pypa/setuptools

Originally reported by: infinity0 (Bitbucket: infinity0, GitHub: infinity0)


$ python setup.py clean --help
[..]
  --all (-a)         remove all build output, not just temporary by-products

I do not see any other way of deleting it via setup.py, so I have to do it manually on top of python setup.py clean --all. This is inconsistent with other build systems, and what Debian packaging expects.


bug major

Most helpful comment

_Original comment by_ neothemachine (Bitbucket: neothemachine, GitHub: neothemachine):


I just came across the same problem, I was actually even expecting that it would work with a plain clean, didn't know there was an --all option. In my case I include different package_data files depending on whether it's a source or binary distribution. That means, when I run bdist_wheel it leaves SOURCES.txt behind which is then read in again by sdist and this messes up everything. To fix that, I included the following hack in my setup.py:

#!python

cmdline = ''.join(sys.argv[1:])
if 'clean' in cmdline:
    shutil.rmtree('projectname.egg-info', ignore_errors=True)

>All comments

_Original comment by_ neothemachine (Bitbucket: neothemachine, GitHub: neothemachine):


I just came across the same problem, I was actually even expecting that it would work with a plain clean, didn't know there was an --all option. In my case I include different package_data files depending on whether it's a source or binary distribution. That means, when I run bdist_wheel it leaves SOURCES.txt behind which is then read in again by sdist and this messes up everything. To fix that, I included the following hack in my setup.py:

#!python

cmdline = ''.join(sys.argv[1:])
if 'clean' in cmdline:
    shutil.rmtree('projectname.egg-info', ignore_errors=True)
Was this page helpful?
0 / 5 - 0 ratings