mctools / mcpl

Monte Carlo Particle Lists
https://mctools.github.io/mcpl/
Other
29 stars 13 forks source link

Please add explicit python3 in pymcpltool #! header #55

Closed willend closed 2 years ago

willend commented 3 years ago

When attempting to package mcpl using CMake/CPack/rpm on CentOS 8, one faces

+ /usr/lib/rpm/redhat/brp-mangle-shebangs
*** ERROR: ambiguous python shebang in /usr/local/mcstas/3.1/bin/pymcpltool: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
error: Bad exit status from /var/tmp/rpm-tmp.2uqApQ (%install)
    Bad exit status from /var/tmp/rpm-tmp.2uqApQ (%install)
 ***

Very likely other distributions will follow, for instance Ubuntu 20.04 only has /usr/bin/python if one installs either of the packages

python-is-python3 - symlinks /usr/bin/python to python3
python-is-python2 - symlinks /usr/bin/python to the DEPRECATED python2
tkittel commented 3 years ago

Acknowledged, we should change the shebang to python3, I guess systems without python3 are rare enough now that we can hope it won't affect too many. I'll see when I have time, probably after easter.

tkittel commented 2 years ago

Coming back to this. I think there is no perfect solution right now, as there are systems out there with only a python3 command, and some with a python command (really python2) but no python3 command. I am hoping that in ~1 year perhaps, time will have made the latter type of system effectively disappear. At that point we can change our shebang to python3. In the meantime, people will have to edit the file themselves, or add a python alias to their system.

tkittel commented 2 years ago

So this was changed in MCPL v1.4.0 which was just released. Closing here and waiting to hear the screams from python3 users :-)