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 defective and outdated "shebang" lines #2500

Merged
merged 1 commit into from
Oct 24, 2023
Merged

remove defective and outdated "shebang" lines #2500

merged 1 commit into from
Oct 24, 2023

Conversation

FelixSchwarz
Copy link
Contributor

A shebang must start with "#!" so all the lines "# /usr/bin/env" did not do anything. Furthermore they contained misleading Python versions, e.g. "# /usr/bin/env python3.5" while AIMET now supports only Python 3.8+.

This is a cosmetic change and I'd argue that most (all) of the remaining shebangs should be deleted as well but in this PR I'm just removing the most obvious errors.

@FelixSchwarz
Copy link
Contributor Author

I noticed that the unit tests failed in the jenkins pipeline but unless I messed up I don't see how removing some commented lines could trigger test failures. Could that be just a flaky test?

A shebang must start with "#!" so all the lines "# /usr/bin/env" did not
do anything. Furthermore they contained misleading Python versions, e.g.
"# /usr/bin/env python3.5" while AIMET now supports only Python 3.8+.

Signed-off-by: Felix Schwarz <[email protected]>
@FelixSchwarz
Copy link
Contributor Author

Jenkins is happy now :-)

Copy link
Contributor

@quic-bharathr quic-bharathr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @FelixSchwarz Thanks for this PR. Could you possibly update this PR to use the following shebang in all files from where you removed the faulty one? That would make it consistant.
#!/usr/bin/env python3

@FelixSchwarz
Copy link
Contributor Author

FelixSchwarz commented Oct 22, 2023

I can certainly do that. However my initial premise was that all of these shebang lines are meaningless (except maybe a few real scripts) so we should remove them all. Before going through each file and checking if a shebang makes sense I wanted to remove the ones which can be removed obviously (because they do not work anyway).

As a follow-up I would like to check the remaining ones and remove these. If consistency is a primary concern, I see two possible approaches going forward:

  • Replace faulty shebang lines with valid ones as you suggested. This will make it harder to get rid of all unnecessary shebangs.
  • "Go big": I'll also remove all the unnecessary shebang lines in this PR.

My questions now:

  • Do you agree that we should get rid of all unnecessary shebang lines? (just so I don't spend time on implementing something that is not merged afterwards)
  • Could you approve a change for option 2 - removing all unnecessary shebangs in one go?

In the end, this is merely an aesthetic change, though one that really triggers my "inner monk". I don't want to spend too much time on this. We have more substantial changes in the queue, such as compiling against newer versions of ONNX Runtime and implementing some CMake improvements. However when looking at these shebangs I can't help but cringe.

@quic-akhobare
Copy link
Contributor

I can certainly do that. However my initial premise was that all of these shebang lines are meaningless (except maybe a few real scripts) so we should remove them all. Before going through each file and checking if a shebang makes sense I wanted to remove the ones which can be removed obviously (because they do not work anyway).

As a follow-up I would like to check the remaining ones and remove these. If consistency is a primary concern, I see two possible approaches going forward:

  • Replace faulty shebang lines with valid ones as you suggested. This will make it harder to get rid of all unnecessary shebangs.
  • "Go big": I'll also remove all the unnecessary shebang lines in this PR.

My questions now:

  • Do you agree that we should get rid of all unnecessary shebang lines? (just so I don't spend time on implementing something that is not merged afterwards)
  • Could you approve a change for option 2 - removing all unnecessary shebangs in one go?

In the end, this is merely an aesthetic change, though one that really triggers my "inner monk". I don't want to spend too much time on this. We have more substantial changes in the queue, such as compiling against newer versions of ONNX Runtime and implementing some CMake improvements. However when looking at these shebangs I can't help but cringe.

I am with you @FelixSchwarz - these shebang lines are useless since AIMET is a library - I am not aware of any scripts that need to be run on command line. I have approved the PR. Thanks a lot for this cleanup.

@FelixSchwarz
Copy link
Contributor Author

@quic-bharathr What can I do about this now? @quic-akhobare approved but you requested changes...

@quic-bharathr quic-bharathr merged commit a339da1 into quic:develop Oct 24, 2023
2 checks passed
@FelixSchwarz FelixSchwarz deleted the remove-bad-python-versions-in-shebang branch October 24, 2023 08:21
@FelixSchwarz
Copy link
Contributor Author

Thank you :-)

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.

3 participants