setuptools does not seem to provide the ability to completely change or completely get rid of the suffix. The magic happens in distutils/command/build_ext.py :
def get_ext_filename(self, ext_name): from distutils.sysconfig import get_config_var ext_path = ext_name.split('.') ext_suffix = get_config_var('EXT_SUFFIX') return os.path.join(*ext_path) + ext_suffix
It looks like I will need to add a rename action after the build.
Update from 12/08/2016:
Ok, I forgot to actually post the solution. In fact, I performed the rename action by overloading the built-in install_lib command. Here's the logic:
from distutils.command.install_lib import install_lib as _install_lib def batch_rename(src, dst, src_dir_fd=None, dst_dir_fd=None): '''Same as os.rename, but returns the renaming result.''' os.rename(src, dst, src_dir_fd=src_dir_fd, dst_dir_fd=dst_dir_fd) return dst class _CommandInstallCythonized(_install_lib): def __init__(self, *args, **kwargs): _install_lib.__init__(self, *args, **kwargs) def install(self):
Now all you have to do is reload the command in the setup function:
setup( ... cmdclass={ 'install_lib': _CommandInstallCythonized, }, ... )
However, I am not happy with the overload of standard commands; If you find a better solution, post it and I will accept your answer.
source share