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 446B7A0546; Fri, 17 Jul 2020 14:42:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 91AD21C0D8; Fri, 17 Jul 2020 14:42:20 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A5D1E1C0D5 for ; Fri, 17 Jul 2020 14:42:18 +0200 (CEST) IronPort-SDR: Vo+AO10xOBVIRplrUJLiXDH/EAlSnymJiJv1RCorRFtNbCoxATuAgi+cxpXO9svQNn3gUo+IlR 2K6KDqjuWcfg== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="234431331" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="234431331" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 05:42:17 -0700 IronPort-SDR: FeURuT+tSPVUEItjTKFzOy0CZ7onmMQL3qXdiFdgDdHRzUDIwa4rYVzL+0ToUTDtseukUp5uVd wbpTkV64QMQw== X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="430830303" Received: from bricha3-mobl.ger.corp.intel.com ([10.213.193.115]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 17 Jul 2020 05:42:15 -0700 Date: Fri, 17 Jul 2020 13:42:09 +0100 From: Bruce Richardson To: Stephen Hemminger Cc: Robin Jarry , Louise Kilheeney , dev@dpdk.org, david.marchand@redhat.com Message-ID: <20200717124209.GB708@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716140121.7a6da720@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 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. Regards, /Bruce