[Distutils] setup.py clean questions

M.-A. Lemburg mal@lemburg.com
Fri Feb 16 04:27:00 2001


Jeremy Hylton wrote:
> 
> >>>>> "JK" == Jeremy Kloth <jeremy.kloth@fourthought.com> writes:
> 
>   JK> Jeremy Hylton wrote:
> 
>   >> Late in the process, I decided to read the source and discovered
>   >> a --all option to clean.  That indeed got rid of most of the
>   >> stuff I was interested in, but spewed even more warnings about
>   >> directories that didn't exist.  It did not, however, remove the
>   >> 2.0 directories.
> 
>   JK> Distutils only knows about the current version of Python that
>   JK> you run the setup.py script with.  In the case of
>   JK> lib.linux-i686-2.1, it appears you are running Python 2.1, hence
>   JK> the -2.1 on the directory.  So, if you want to clean 2.0
>   JK> directories, run the setup.py script with Python 2.0.
> 
> Perhaps there should be a realclean or distclean that actually removes
> all this stuff.  I don't want to run setup.py twice with two different
> Python's just to clean up.

Good point, but unfortunately difficult to implement since the
clean command gets its parameter from the build command and
you can easily override the names of the various build directories
on the command line or via setup.cfg.

OTOH, the clean could simply *try* to remove the directory
trees using the default names and produce a warning in case 
this fails. We'd then need to expose the temp name generation logic
in the build command, e.g. 'rm -rf temp.<platform>-* lib.<platform>-*'
should do the trick. Alternatively, the clean command could simply
remove the complete build_base tree...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/