Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless or unused shebang lines #13

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

musicinmybrain
Copy link
Contributor

The first commit removes shebangs (#!) from non-script sources.

These files have no if __name__ == "__main__" or similar and no interesting side effects. They are only meant to be imported. Therefore, a shebang line is not useful.


The second commit removes shebangs from non-executable scripts.

These could use a shebang line, but the executable bit is not set, so it will never be useful.

Leaving the shebang lines and making the files executable would be an alternative, but it doesn’t seem necessary:

  • For setup.py, the traditional invocation is something like python3 setup.py …, and this will work fine without a shebang.

  • For hybridizer/shybrid.py, end-users will run the entry point script shybrid generated by setuptools instead, and developers can still run PYTHONPATH="${PWD}" python3 hybridizer/shybrid.py or PYTHONPATH="${PWD}" python3 -m hybridizer.shybrid if they like.

These files have no “if __name__ == "__main__"” or similar and no
interesting side effects. They are only meant to be imported. Therefore,
a shebang line (#!) is not useful.
These *could* use a shebang line, but the executable bit is not set, so
it will never be useful.

Leaving the shebang lines and making the files executable would be an
alternative, but:

  - For setup.py, the traditional invocation is something like “python3
    setup.py …”, and this will work fine without a shebang.

  - For hybridizer/shybrid.py, end-users will run the entry point script
    “shybrid” generated by setuptools instead, and developers can still
    run “PYTHONPATH="${PWD}" python3 hybridizer/shybrid.py” or
    “PYTHONPATH="${PWD}" python3 -m hybridizer.shybrid” if they like.
@jwouters91
Copy link
Owner

jwouters91 commented Dec 20, 2021

Thank you for contributing these changes. I see no reason to keep the shebang lines (fyi, which were autogenerated by my IDE back in the day), so I'll merge your commits right away.

@jwouters91 jwouters91 merged commit 2afed0b into jwouters91:master Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants