Skip to content

Clean up shebang warnings#159

Merged
dirk-thomas merged 1 commit intoros-infrastructure:masterfrom
cottsay:shebangs
Mar 26, 2019
Merged

Clean up shebang warnings#159
dirk-thomas merged 1 commit intoros-infrastructure:masterfrom
cottsay:shebangs

Conversation

@cottsay
Copy link
Copy Markdown
Member

@cottsay cottsay commented Sep 17, 2018

These are minor clean-ups for issues discovered during Fedora packaging. To date, these issues have been addressed in the packaging workflow directly. Moving the changes upstream means we can remove the workarounds in the packaging workflows.

Examples of the errors we're seeing from rpmlint:

python2-rospkg.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/rospkg/os_detect.py 644 /usr/bin/python2 
python2-rospkg.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/rospkg/rosversion.py 644 /usr/bin/python2

There are two related changes here:

  1. os_detect.py has a shebang and __main__, but isn't executable. Either:
    a. The shebang should be removed (this is the change I'm proposing, after feedback)
    b. The file should be made executable (this is the change I'm proposing)
  2. rosversion.py has a shebang, but no __main__ handler. Either:
    a. The shebang should be removed (this is the change I'm proposing)
    b. __main__ should be added and the file should be made executable. Since console_scripts takes care of this at installation time, I don't think this is the right thing to do.

@dirk-thomas
Copy link
Copy Markdown
Member

1.b.

I don't think making the Python module executable is necessary - in the installed case the file shouldn't be executable. I would choose 1.a. instead. The __main__ still allows to call the module with python src/rospkg/os_detect.py for a quick test of the OS detection.

2.a.

👍

@cottsay cottsay changed the title Clean-up shebang warnings Clean up shebang warnings Sep 17, 2018
nuclearsandwich pushed a commit to ros-infrastructure/rosdep that referenced this pull request Nov 2, 2018
Two classes of changes here:
1. `catkin_support.py` is executable, but has no shebang, so I removed
the executable bit.
2. `main.py` has a shebang and `__main__` handler, and I removed it. It
can still be executed directly using the python executable, but like
with ros-infrastructure/rospkg#159, it doesn't make sense to have
executable scripts in the module.
at-wat pushed a commit to at-wat/rosdep that referenced this pull request Nov 15, 2018
Two classes of changes here:
1. `catkin_support.py` is executable, but has no shebang, so I removed
the executable bit.
2. `main.py` has a shebang and `__main__` handler, and I removed it. It
can still be executed directly using the python executable, but like
with ros-infrastructure/rospkg#159, it doesn't make sense to have
executable scripts in the module.
@dirk-thomas
Copy link
Copy Markdown
Member

Please comment on the PR after updating the patch. I just saw the changes by accident.

Anyway it looks good to me now. Thanks for the patch.

@dirk-thomas dirk-thomas merged commit 337b61b into ros-infrastructure:master Mar 26, 2019
@cottsay cottsay deleted the shebangs branch June 3, 2020 17:55
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