Discussion:
python related rpmlint complaint
Greg Freemyer
2014-08-20 16:24:36 UTC
Permalink
All,

I had a package (python-dfVFS) that rpmlint is complaining about. I
can get the error to go away via these 2 lines in the %files section
of the specfile.

%defattr(755,root,root)
%{python_sitelib}/dfvfs

I'm told 755 is likely wrong for anything in python_sitelib.

My rpmlint errors without the 755 statement are similar to:

[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/vfs/tar_file_system_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/file_io/fake_file_io_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/helpers/source_scanner_test.py
0644L /usr/bin/python

The files seem to start with:

#!/usr/bin/python
# -*- coding: utf-8 -*-
.
.
.

There are hundreds of the files. Should I run a sed script to trash
"#!/usr/bin/python" in all the files. There are over 150 of them.

Thanks
Greg
--
Greg Freemyer
--
To unsubscribe, e-mail: opensuse-packaging+***@opensuse.org
To contact the owner, e-mail: opensuse-packaging+***@opensuse.org
Dominique Leuenberger a.k.a. Dimstar
2014-08-20 17:35:56 UTC
Permalink
Post by Greg Freemyer
All,
I had a package (python-dfVFS) that rpmlint is complaining about. I
can get the error to go away via these 2 lines in the %files section
of the specfile.
%defattr(755,root,root)
%{python_sitelib}/dfvfs
I'm told 755 is likely wrong for anything in python_sitelib.
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/vfs/tar_file_system_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/file_io/fake_file_io_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/helpers/source_scanner_test.py
0644L /usr/bin/python
#!/usr/bin/python
# -*- coding: utf-8 -*-
.
.
.
There are hundreds of the files. Should I run a sed script to trash
"#!/usr/bin/python" in all the files. There are over 150 of them.
I would try to contact upstream, pointing out that this there is no
need for a shebang in those files...

Dominique
--
To unsubscribe, e-mail: opensuse-packaging+***@opensuse.org
To contact the owner, e-mail: opensuse-packaging+***@opensuse.org
Josef Reidinger
2014-08-20 17:43:28 UTC
Permalink
On Wed, 20 Aug 2014 17:35:56 +0000
Post by Dominique Leuenberger a.k.a. Dimstar
Post by Greg Freemyer
All,
I had a package (python-dfVFS) that rpmlint is complaining about. I
can get the error to go away via these 2 lines in the %files section
of the specfile.
%defattr(755,root,root)
%{python_sitelib}/dfvfs
I'm told 755 is likely wrong for anything in python_sitelib.
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/vfs/tar_file_system_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/file_io/fake_file_io_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/helpers/source_scanner_test.py
0644L /usr/bin/python
#!/usr/bin/python
# -*- coding: utf-8 -*-
.
.
.
There are hundreds of the files. Should I run a sed script to trash
"#!/usr/bin/python" in all the files. There are over 150 of them.
I would try to contact upstream, pointing out that this there is no
need for a shebang in those files...
Dominique
Well, this files according to its names are tests, for which it is nice
if they are self-executable, so you can easily run it, so I think
upstream do not want to remove it.

Josef
--
To unsubscribe, e-mail: opensuse-packaging+***@opensuse.org
To contact the owner, e-mail: opensuse-packaging+***@opensuse.org
Greg Freemyer
2014-08-20 18:07:22 UTC
Permalink
Post by Josef Reidinger
On Wed, 20 Aug 2014 17:35:56 +0000
Post by Dominique Leuenberger a.k.a. Dimstar
Post by Greg Freemyer
All,
I had a package (python-dfVFS) that rpmlint is complaining about. I
can get the error to go away via these 2 lines in the %files section
of the specfile.
%defattr(755,root,root)
%{python_sitelib}/dfvfs
I'm told 755 is likely wrong for anything in python_sitelib.
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/vfs/tar_file_system_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/file_io/fake_file_io_test.py
0644L /usr/bin/python
[ 29s] python-dfVFS.noarch: W: non-executable-script
/usr/lib/python2.7/site-packages/dfvfs/helpers/source_scanner_test.py
0644L /usr/bin/python
#!/usr/bin/python
# -*- coding: utf-8 -*-
.
.
.
There are hundreds of the files. Should I run a sed script to trash
"#!/usr/bin/python" in all the files. There are over 150 of them.
I would try to contact upstream, pointing out that this there is no
need for a shebang in those files...
Dominique
Well, this files according to its names are tests, for which it is nice
if they are self-executable, so you can easily run it, so I think
upstream do not want to remove it.
Josef
Interesting thought, but there are 189 *.py files in the upstream
tarball. 188 of them have /usr/biin/python in them.

It seems they have gone overboard.

I have notified upstream of the issue. In the meantime I'm going to
do some basic testing with the #!/usr/bin/python line removed.

Thanks
Greg
--
To unsubscribe, e-mail: opensuse-packaging+***@opensuse.org
To contact the owner, e-mail: opensuse-packaging+***@opensuse.org
Jan Engelhardt
2014-08-20 18:08:47 UTC
Permalink
Post by Josef Reidinger
Post by Dominique Leuenberger a.k.a. Dimstar
Post by Greg Freemyer
#!/usr/bin/python
# -*- coding: utf-8 -*-
I would try to contact upstream, pointing out that this there is no
need for a shebang in those files...
Dominique
Well, this files according to its names are tests, for which it is nice
if they are self-executable, so you can easily run it, so I think
upstream do not want to remove it.
There may also be editors around which are configured to look for
patterns just like "#!/usr/bin/python" as an indicator to pick
a particular syntax highlighting ruleset (in case other measures
fail, like .py extension, # -*- python -*-, etc.)

IMO the rpmlint check adds too much noise.
--
To unsubscribe, e-mail: opensuse-packaging+***@opensuse.org
To contact the owner, e-mail: opensuse-packaging+***@opensuse.org
Loading...