root icon indicating copy to clipboard operation
root copied to clipboard

Replace `#!usr/bin/env @python@` with `#!usr/bin/env python`

Open jmcarcell opened this issue 2 years ago • 5 comments

This Pull request:

Replace the shebang with python for the python scripts under main/python

Changes or fixes:

Use /usr/bin/env python as it is done everywhere else in ROOT (in some places it's python3 instead of python). Avoid having to deal with the length of the shebang being too long when using a python installed in deep locations (like in deep folder paths in cvmfs).

I believe this shouldn't change anything in most setups except in those where ROOT was built with one python and then the first python found in PATH is a different one, but that is a weird setup (?). Alternatively it may be possible to substitute only the name of the python executable, like python3.11, but then it has to be in PATH. but I think this is the cleanest way and the cases where this wouldn't work would be related to issues in the environment rather than ROOT itself.

Checklist:

  • [x] tested changes locally
  • [ ] updated the docs (if necessary)

jmcarcell avatar Aug 02 '23 12:08 jmcarcell

Test Results

    10 files      10 suites   2d 5h 47m 24s :stopwatch:  2 636 tests  2 556 :white_check_mark: 0 :zzz: 80 :x: 25 131 runs  25 051 :white_check_mark: 0 :zzz: 80 :x:

For more details on these failures, see this check.

Results for commit 9967ce75.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Aug 04 '23 06:08 github-actions[bot]

TBH, I'm a bit reluctant with this PR. Not sure what the benefit is and what it solves. At least it doesn't work everywhere... And maybe @Axel-Naumann or @vepadulano might give their opinion about it?

bellenot avatar Aug 08 '23 08:08 bellenot

python does not exist as an alias to python3 on all platforms we support. It might be that all platforms have python3 though. So maybe use that? But we should only do this after we have removed support for Python 2.

Axel-Naumann avatar Aug 08 '23 13:08 Axel-Naumann

On Windows there is only Python.exe

bellenot avatar Aug 08 '23 13:08 bellenot

Okay so we need to configure this, but we should probably use the base name as suggested by @jmcarcell

Axel-Naumann avatar Aug 08 '23 13:08 Axel-Naumann

Closing this PR, as the author didn't follow up on the comments, nor made sure it works on all platforms (Windows didn't work).

@jmcarcell, please feel free to re-open if you still want to follow up here! Thanks.

guitargeek avatar Nov 29 '24 12:11 guitargeek