python - package_data files with executable permissions -
i using distutils create python (2) package installer. in package couple of binary executable called python code. listing these package_data
in setup.py
file installed along package. however, distutils not copy executable permission bit on these files when installed. there way force distutils install package_data
files executable permissions?
figured out based on other answers - following works:
class my_install_lib(distutils.command.install_lib.install_lib): def run(self): distutils.command.install_lib.install_lib.run(self) fn in self.get_outputs(): if <this 1 of binaries want executable>: # copied distutils source - make binaries executable mode = ((os.stat(fn).st_mode) | 0555) & 07777 distutils.log.info("changing mode of %s %o", fn, mode) os.chmod(fn, mode)
and pass cmdclass={'install_lib':my_install_lib}
setup
.
Comments
Post a Comment