[Distutils] [buildout] profiling stuff with cProfile

Chris Withers chris at simplistix.co.uk
Thu Sep 3 01:49:54 CEST 2009


Chris Withers wrote:
> Gary Poster wrote:
>>
>> The same is true for -c, which we've had for awhile and has the same 
>> rough edge.  (I changed that in a hacky way for my branch for -c, and 
>> now for -m.  I'll be trying to change that to use optparse very soon, 
>> though someone may beat me to it.)
> 
> Do you have your patches for this to hand?
> 
> I want to profile some stuff but I hit the above problem with, for example:
> 
> bin/py -m cProfile -o test.profile bin/test

Okay, well, with the following entrypoint:

setup(
...
     entry_points = {
         'console_scripts': [
             'profile = cProfile:main',
         ],
         },
     )

You can now do:

bin/profile -o tests.profile bin/test

Hope this helps!

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


More information about the Distutils-SIG mailing list