[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cdbs to remove *.pyc on clean?

On Mon, Apr 10, 2006 at 06:59:04PM +0200, Peter Eisentraut wrote:
> I have a question on the bug report #252134 "cdbs: python-distutils.mk 
> should remove .pyc files on clean".  It seems that python setup.py 
> clean actually creates a number .pyc files itself, and quite a number 
> of packages therefore have code along the lines of
> clean::
> 	find . -name '*.pyc' -exec rm '{}' ';'
> in them.  I'm considering adding exactly that line to cdbs.  The 
> question is whether that is too far reaching.  I'm not an expert on the 
> issue, but it seems unlikely that an upstream tarball or a clean source 
> package should contain .pyc files.  So it seems OK to me.  Does anyone 
> think this change would be a bad idea, or does anyone perhaps have a 
> better solution for this bug?

It sounds OK to me. .pyc files in upstream tarball are most certainly an
error (and if upstream ships a required .pyc without the corresponding
.py, the package is probably non DFSG free). 

Running setup.py will create .pyc for files in the module imported by
setup.py. For instance, logilab's packages use a common setup.py file
and put changing information (version number, description, etc.) in
__pkginfo__.py which is imported by setup.py, thus creating

While you are at it, I suggest that you expand a little bit you search
and use '*.py[co]'. It probably won't catch a lot more files (optimized
bytecode is not that common), but does not involve a very high overhead. 

Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

Attachment: signature.asc
Description: Digital signature

Reply to: