def run(self):
    """ Overload the run method and remove all .py files after compilation
        """
super(install_lib, self).run()
for filename in self.install():
    if filename.endswith('.py'):
        os.unlink(filename)

def get_outputs(self):
    """ Overload the get_outputs method and remove any .py entries in the
        file list """
filenames = super(install_lib, self).get_outputs()
return [filename for filename in filenames if not filename.endswith('.py')]
Как удалить исходный код из бинарных дистрибутивов distutils?