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

Python test files have a shebang line but are not executable #461

Closed
kbabioch opened this issue Dec 20, 2018 · 4 comments
Closed

Python test files have a shebang line but are not executable #461

kbabioch opened this issue Dec 20, 2018 · 4 comments

Comments

@kbabioch
Copy link
Contributor

Describe the bug
While building the package in the openSUSE build system, I get the following warnings:

[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/all_tests.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/example_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_filesystem_glob_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_filesystem_shutil_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_filesystem_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_filesystem_unittest_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_filesystem_vs_real_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_open_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_os_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_pathlib_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_stat_time_test.py 644 /usr/bin/env python
[   22s] python2-pyfakefs.noarch: W: non-executable-script /usr/lib/python2.7/site-packages/pyfakefs/tests/fake_tempfile_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/all_tests.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/example_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_filesystem_glob_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_filesystem_shutil_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_filesystem_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_filesystem_unittest_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_filesystem_vs_real_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_open_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_os_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_pathlib_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_stat_time_test.py 644 /usr/bin/env python
[   22s] python3-pyfakefs.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/pyfakefs/tests/fake_tempfile_test.py 644 /usr/bin/env python
[   22s] This text file contains a shebang or is located in a path dedicated for
[   22s] executables, but lacks the executable bits and cannot thus be executed.  If
[   22s] the file is meant to be an executable script, add the executable bits,
[   22s] otherwise remove the shebang or move the file elsewhere.

And the script warning me about this, is right. To be consistent we should either get rid of the shebang line (after all, these tests are not invoked directly), or set the executable bit, so that they can be invoked directly.

How To Reproduce
Check the file permission and content of these files.

Your enviroment
General to all environments, since this is only about the source tarball.

@mrbean-bremen
Copy link
Member

You are right, the shebang doesn't make much sense in tests.
@jmcgeheeiv - what do you think? Is it ok to remove the shebang, or shall we rather set the executable bit?

Also, it looks like you would need a new PyPi version with the fix... after we did a release only yesterday.

@mrbean-bremen
Copy link
Member

Ok, you may checkout the new release.

@jmcgeheeiv
Copy link
Contributor

jmcgeheeiv commented Dec 21, 2018

It seems to me that the following should have their permission changed to 755 and retain the shebang:

  • all_tests.py
  • all_tests_without_extra_packages.py
  • example_test.py

However this is not a big deal and can wait for the next release.

@mrbean-bremen
Copy link
Member

Ok, thanks! I was a bit too fast - will do this for the next release then (maybe we will have a real 3.6 release some time...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants