From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED425A053D; Fri, 17 Jul 2020 18:24:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4495F1BEB4; Fri, 17 Jul 2020 18:24:25 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 65F5F2C01 for ; Fri, 17 Jul 2020 18:24:23 +0200 (CEST) IronPort-SDR: YklD/+AiPDiQDPWBLQRNxVlY36/4lu5EMJrPvzwCHSskqDcWRN+2lhiq4Gd8/eJM8czDMyTF0L qHNuTMgN5Glw== X-IronPort-AV: E=McAfee;i="6000,8403,9685"; a="129190309" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="129190309" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 09:24:22 -0700 IronPort-SDR: 2tY2LQcAHaDTAiddDY+8PQaswaKPdylBjbJ3OZ299ciF1vgRwYZNVNxESsX92hsX9hy8v5PNum OPg4wcqTuYOA== X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="460897216" Received: from bricha3-mobl.ger.corp.intel.com ([10.213.193.115]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 17 Jul 2020 09:24:20 -0700 Date: Fri, 17 Jul 2020 17:24:17 +0100 From: Bruce Richardson To: Stephen Hemminger Cc: Robin Jarry , Louise Kilheeney , dev@dpdk.org, david.marchand@redhat.com Message-ID: <20200717162417.GC719@bricha3-MOBL.ger.corp.intel.com> References: <20200710101055.33671-1-louise.kilheeney@intel.com> <20200710133358.j535wy7onvelu3ln@6wind.com> <20200713092149.GB694@bricha3-MOBL.ger.corp.intel.com> <20200716144429.tf3agu7tfpy4nfp7@6wind.com> <20200716140121.7a6da720@hermes.lan> <20200717124209.GB708@bricha3-MOBL.ger.corp.intel.com> <20200717080623.24ba9d1d@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717080623.24ba9d1d@hermes.lan> Subject: Re: [dpdk-dev] [PATCH 0/9] python2 deprecation notice X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 17, 2020 at 08:06:23AM -0700, Stephen Hemminger wrote: > On Fri, 17 Jul 2020 13:42:09 +0100 > Bruce Richardson wrote: > > > On Thu, Jul 16, 2020 at 02:01:21PM -0700, Stephen Hemminger wrote: > > > On Thu, 16 Jul 2020 16:44:29 +0200 > > > Robin Jarry wrote: > > > > > > > 2020-07-13, Bruce Richardson: > > > > > 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? > > > > > > > > I have found a hacky[1] but somewhat not too ugly way to dynamically use > > > > any available python interpreter. > > > > > > > > Basically, the scripts shebangs become: > > > > > > > > #!/bin/sh > > > > # shell script hack to dynamically use any available python interpreter > > > > ''':' > > > > if command -pv python3 >/dev/null 2>&1; then > > > > exec python3 "$0" "$@" > > > > else > > > > exec python2 "$0" "$@" > > > > fi > > > > ''' > > > > # real python code starts here > > > > > > > > This hack obviously would remain only for the time where we still have > > > > python 2 support and can be removed after 20.08 is released. > > > > > > > > What do you think? > > > > > > > > [1] https://unix.stackexchange.com/a/66242 > > > > > > > > > > No. > > > > I could live with this, but I think that python3 is widespread enough now > > to just go with the simpler solution of python3 by default while still > > allowing others to run with python2 explicitly if they so desire. > > > > I think we have covered a number of options, but I'm not sure we have > > converged on an agreed solution. Here are the options I would consider: > > > > 0. Do nothing to the code, and just print deprecation notice in docs. This > > will violate the previously documented plan, but won't break anything for > > anyone. > > 1. Just add deprecation notice but leave shebang lines unchanged, meaning > > lots of people see the notice but don't need to care since they just call > > the script. > > 2. As #1, but check if python3 is available and only print deprecation > > notice if not > > 3. Add deprecation notice, and change shebang lines to use python3. This > > means that anyone who does not have python3 installed will see a breaking > > change > > 4. Change shebangs to use python3 and detect at "make" build time if > > python3 is available. If py3 is unavailable, adjust shebang and add > > deprecation warning on "make install". > > 5. Use shell-hack above. > > > > Any other options I'm missing? > > > > For me, I think I can live with all options bar #1. Probably my top > > preference would be #4 or #2, with #0 and #4 next best thereafter. > > > > 6. Change shebangs to use python3 and don't bother detecting. > Since distributions will have python3. > This was what our originally patch submission was to do, but it was pointed out that we said we would have deprecation notices in the scripts in 20.08 and only remove fully in 20.11 > 7. Change shebangs and keep the python2 compat imports This is pretty much the same as #3. The python2 compat imports etc. will be removed in 20.11 anyway, so we can ignore those I think. > > 8. Other alternative I have seen in code is to use > try block in the import section: > > try: > # for Python2 > from Tkinter import * > except ImportError: > # for Python3 > from tkinter import * > > But supporting python2 for a longer time makes no sense.a This is already done in DPDK. All scripts already support both python2 and python3 AFAIK. If any don't, it's a bug. > > I would go for #0 for 20.08 and full python3 in 20.11 (#3) > Full python3 in 20.11 is indeed the already agreed plan. All python2 compatibility will be removed then. /Bruce