On Fri, Jul 10, 2020 at 03:33:58PM +0200, Robin Jarry wrote: > Hi Louise, > > 2020-07-10, Louise Kilheeney: > > This patchset adds deprecation notices to python scripts, > > warning of the removal of python2 support from the DPDK 20.11 release. > > While showing warnings to users about Python 2 support drop in 20.11 is > good, it seems like the shebangs in a lot of these scripts still refer > to "python". > > dpdk$ git describe > v20.05-623-geff30b59cc2e > dpdk$ git grep '#.*!.*python\>' > app/test-bbdev/test-bbdev.py:1:#!/usr/bin/env python > app/test-cmdline/cmdline_test.py:1:#!/usr/bin/env python > app/test/autotest.py:1:#!/usr/bin/env python > buildtools/map_to_win.py:1:#!/usr/bin/env python > config/arm/armv8_machine.py:1:#!/usr/bin/python > devtools/update_version_map_abi.py:1:#!/usr/bin/env python > usertools/cpu_layout.py:1:#!/usr/bin/env python > usertools/dpdk-devbind.py:1:#! /usr/bin/env python > usertools/dpdk-pmdinfo.py:1:#!/usr/bin/env python > usertools/dpdk-telemetry-client.py:1:#! /usr/bin/env python > > On many distros, "python" still points (as of today) to python2. You > series will cause warnings that cannot be avoided. > > Also, on some distros, "python" does not exist at all (RHEL 8 and CentOS > 8 for example). And only "python2" or "python3" are available. > > I wonder if it would not be better to find a way to make these shebangs > "dynamic" somehow. It is not trivial and I don't see any other solution > than plain modification of the shebangs at build time. > > However, there is no way (to my knowledge) to specify which version of > python is "selected" during the build. > > Does anyone have a proper solution? >
In the absense of a "proper" solution, is the simplest option to change the shebangs to all be python3, but leave the python2 compatibility in place, and add the warnings for anyone running it explicitly using python2?