From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: python3 script header and rhel8
Date: Tue, 28 Jan 2020 16:07:47 +0000 [thread overview]
Message-ID: <20200128160747.GQ1446339@redhat.com> (raw)
In-Reply-To: <2cb797a9-25ec-8b36-2268-ec9638b14e1e@virtuozzo.com>
On Tue, Jan 28, 2020 at 03:44:04PM +0000, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
>
> Hmm Qemu dropped support for python2, and anyway python2 is not supported now at all.
>
> Still, we have a lot of "#!/usr/bin/env python" headings in our scripts, which is
> unsupported by rhel8 by default. So, for example, because of such line in
> tests/qemu-iotests/nbd-fault-injector.py, iotest 277 fails.
>
> Of course, it's simple to set python in rhel8 to be python3... But should we fix
> all the headings to be "#!/usr/bin/env python3"? Or what is the correct heading
> for scripts in a new python3 world?
Using "#!/usr/bin/env python3" is probably our best choice, as it
makes it absolutely clear we're not happy with a python2 impl.
> # git grep -l '^#!/usr/bin/env python$'
> scripts/analyse-9p-simpletrace.py
> scripts/analyse-locks-simpletrace.py
> scripts/decodetree.py
> scripts/device-crash-test
> scripts/kvm/kvm_flightrecorder
> scripts/qapi-gen.py
> scripts/render_block_graph.py
> scripts/replay-dump.py
> scripts/simpletrace.py
> scripts/tracetool.py
> scripts/tracetool/__init__.py
> scripts/tracetool/backend/__init__.py
> scripts/tracetool/backend/dtrace.py
> scripts/tracetool/backend/ftrace.py
> scripts/tracetool/backend/log.py
> scripts/tracetool/backend/simple.py
> scripts/tracetool/backend/syslog.py
> scripts/tracetool/backend/ust.py
> scripts/tracetool/format/__init__.py
> scripts/tracetool/format/c.py
> scripts/tracetool/format/d.py
> scripts/tracetool/format/h.py
> scripts/tracetool/format/log_stap.py
> scripts/tracetool/format/simpletrace_stap.py
> scripts/tracetool/format/stap.py
> scripts/tracetool/format/tcg_h.py
> scripts/tracetool/format/tcg_helper_c.py
> scripts/tracetool/format/tcg_helper_h.py
> scripts/tracetool/format/tcg_helper_wrapper_h.py
> scripts/tracetool/format/ust_events_c.py
> scripts/tracetool/format/ust_events_h.py
> scripts/tracetool/transform.py
> scripts/tracetool/vcpu.py
IMHO the '#!/usr/bin/env' header should only be added to files
which are executable scripts - ie a main() method. IOW, it
ought to be removed from all these tracetool modules.
> tests/acceptance/virtio_seg_max_adjust.py
> tests/acceptance/x86_cpu_model_versions.py
> tests/docker/travis.py
> tests/qapi-schema/test-qapi.py
> tests/qemu-iotests/030
> tests/qemu-iotests/040
> tests/qemu-iotests/041
> tests/qemu-iotests/044
> tests/qemu-iotests/045
> tests/qemu-iotests/055
> tests/qemu-iotests/056
> tests/qemu-iotests/057
> tests/qemu-iotests/065
> tests/qemu-iotests/093
> tests/qemu-iotests/096
> tests/qemu-iotests/118
> tests/qemu-iotests/124
> tests/qemu-iotests/129
> tests/qemu-iotests/132
> tests/qemu-iotests/136
> tests/qemu-iotests/139
> tests/qemu-iotests/147
> tests/qemu-iotests/148
> tests/qemu-iotests/149
> tests/qemu-iotests/151
> tests/qemu-iotests/152
> tests/qemu-iotests/155
> tests/qemu-iotests/163
> tests/qemu-iotests/165
> tests/qemu-iotests/169
> tests/qemu-iotests/194
> tests/qemu-iotests/196
> tests/qemu-iotests/199
> tests/qemu-iotests/202
> tests/qemu-iotests/203
> tests/qemu-iotests/205
> tests/qemu-iotests/206
> tests/qemu-iotests/207
> tests/qemu-iotests/208
> tests/qemu-iotests/209
> tests/qemu-iotests/210
> tests/qemu-iotests/211
> tests/qemu-iotests/212
> tests/qemu-iotests/213
> tests/qemu-iotests/216
> tests/qemu-iotests/218
> tests/qemu-iotests/219
> tests/qemu-iotests/222
> tests/qemu-iotests/224
> tests/qemu-iotests/228
> tests/qemu-iotests/234
> tests/qemu-iotests/235
> tests/qemu-iotests/236
> tests/qemu-iotests/237
> tests/qemu-iotests/238
> tests/qemu-iotests/242
> tests/qemu-iotests/245
> tests/qemu-iotests/246
> tests/qemu-iotests/248
> tests/qemu-iotests/254
> tests/qemu-iotests/255
> tests/qemu-iotests/256
> tests/qemu-iotests/257
> tests/qemu-iotests/258
> tests/qemu-iotests/260
> tests/qemu-iotests/262
> tests/qemu-iotests/264
> tests/qemu-iotests/266
> tests/qemu-iotests/277
> tests/qemu-iotests/280
> tests/qemu-iotests/nbd-fault-injector.py
> tests/qemu-iotests/qcow2.py
> tests/qemu-iotests/qed.py
> tests/vm/basevm.py
> tests/vm/centos
> tests/vm/fedora
> tests/vm/freebsd
> tests/vm/netbsd
> tests/vm/openbsd
> tests/vm/ubuntu.i386
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-01-28 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-28 15:44 python3 script header and rhel8 Vladimir Sementsov-Ogievskiy
2020-01-28 15:58 ` Philippe Mathieu-Daudé
2020-01-28 16:07 ` Daniel P. Berrangé [this message]
2020-01-28 21:51 ` John Snow
2020-01-29 15:58 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200128160747.GQ1446339@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).