From e6358fb0f67fd8db98b57ea5cb3148ba3e61f902 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Sun, 26 Jan 2025 22:57:31 +0000 Subject: [PATCH] Add denoise.py as script in setup.py and set executable flags Signed-off-by: Stefan Marr --- setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4f06cef1..917bc928 100644 --- a/setup.py +++ b/setup.py @@ -19,14 +19,25 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -import sys +import os +import stat from setuptools import setup, find_packages +from setuptools.command.install import install from rebench import __version__ as rebench_version with open("README.md", "r") as fh: long_description = fh.read() +class InstallAndSetDenoisePermissions(install): + def run(self): + install.run(self) + install_path = os.path.join(self.install_lib, "rebench") + denoise_path = os.path.join(install_path, "denoise.py") + if os.path.exists(denoise_path): + st = os.stat(denoise_path) + os.chmod(denoise_path, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) + setup(name='ReBench', version=rebench_version, description='Execute and document benchmarks reproducibly.', @@ -53,6 +64,8 @@ 'rebench-denoise = rebench.denoise:main_func' ] }, + scripts=['rebench/denoise.py'], + cmdclass={'install': InstallAndSetDenoisePermissions}, test_suite='rebench.tests', license='MIT' )