Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: None
Purpose of change
There was some inconsistency and ambiguity in how the
#!
lines in the CDDA Python scripts were written. Want to fix that to make them easier to use and understand.Describe the solution
#!
line, always use/usr/bin/env
to find Python executable.#!
line sayspython2
.#!
line, make sure it is executable.#!
.Describe alternatives you've considered
There are a couple of scripts still that don't specify Python 2 vs 3. Based on comments in the script, it looks like this is deliberate and they should work in both. @mlangsdorf would you prefer that they do specify a particular Python version?
I considered writing something for the CI to check our Python scripts satisfied these properties, but it didn't seem quite worth it.
Testing
Some scripts can now display a help message when they previously couldn't (because my default Python is 3). I didn't actually try to use the scripts 'for real', though.
Additional context
I was about to write a new Python script and came across these inconsistencies which bugged me.