optimized compile with egg files

Matyas msustik at gmail.com
Thu May 1 21:00:17 EDT 2014


Our project is using setuptools to compile. I noticed that by default

python setup.py build

will create .pyc files which I assume are archived into the egg file. I do not know yet how to verify what is in the egg file.

I tried using

python setup.py build_py -O1
python setup.py install --user -O1

in my attempt to compile to .pyo files. Indeed the output indicates that .pyo files are created (I can see them in build/lib.macos-10.9-x86_64-2.7/...)

However I still see the some files being bytecompiled to .pyc files as well. I am not sure where these end up, I cannot find them.

Well I guess I hope for some direction on how to compile optimized using setuptools.

Then how to run the optimized version of the modules? Often we use nosetests to run and nosetests does not take a -O parm like python. Also ipython does not like -O either.

Thanks!



More information about the Python-list mailing list