Skip to content

Commit

Permalink
Add denoise.py as script in setup.py and set executable flags
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jan 26, 2025
1 parent e864535 commit e6358fb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand All @@ -53,6 +64,8 @@
'rebench-denoise = rebench.denoise:main_func'
]
},
scripts=['rebench/denoise.py'],
cmdclass={'install': InstallAndSetDenoisePermissions},
test_suite='rebench.tests',
license='MIT'
)

0 comments on commit e6358fb

Please sign in to comment.