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 2FC98A053D; Fri, 17 Jul 2020 17:06:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 110A11BEE6; Fri, 17 Jul 2020 17:06:34 +0200 (CEST) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 13B4E1BEDD for ; Fri, 17 Jul 2020 17:06:32 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id z3so5502816pfn.12 for ; Fri, 17 Jul 2020 08:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2jYaE6OsDpd39KwS3wcA2jIvfluXeUzn2v52G09wMWA=; b=RY5H5qT4Qx0OnGmK6ckxSelUWhMYgDzVKBmNMQ3UQE4UKUBywCgOipb3+vo3R5a44+ CmN8THJE0x0fY+OtrDMzsxJW8bIQozrru2KKFnAZeX64W8z5U7+VYB0v2RuMoweYblY9 gNDcdR6W7AjQ9XoYYFE4sX3Yels7Dn/0Dk345FayOI1ldpg/cRUDdsvq8TjHvM3RfJTM xeCye7FfcwneFFabgMV9EVKzjWdoJrTf2zjTatQYGloUl/teHotT2Jiw+pzH/VJQjRS/ mACeuB/TxZgPii7ru+6DHJmk1IxpYjKiNRT2UGnQhKC32Ihv4ecyaRXCbb+tDsR300E9 1e1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2jYaE6OsDpd39KwS3wcA2jIvfluXeUzn2v52G09wMWA=; b=rkF+Jy/uiC21bVZ6IPidCZl0SjjNgR6UcJZOmfzqErbDKEflGBKoJPOL6+zmgXPxnr V2OYI9XH+eafcM17xgzpmdvhuKDh9irHqqxwZqkZPKVE+d0dOA1TDCHmmjYYn/bswPyV k8m7SxD+owJjhFquLZMx5k/ny5xNYr+sY+achJQfogzRLQ8PbHGcFDKCELRcuyn8VSUA pV1j0eEzjunm8Cx4NAGYi+TSdo6Vjht0ZYRrU3hh2e91fcZmFSoMzJEKhQ8sR+DctTzY HHP2IZPH3s7UqpJ4Kl/IBwyV5nrVpZH9Je1uef8XCgbGXz7I0j3h8l2BIHirDneIKwZh oZpQ== X-Gm-Message-State: AOAM5313pZ3IhF2RXGLwoOcxBsPjE6+uGa/VOj1zc+7wKZe4PuGyx618 /2RutpgVafBFGz1UeSjArnWyVw== X-Google-Smtp-Source: ABdhPJzxkwwlqYUlO+9PDm6kdjqgZ1VoOBb2Qa6HaBaJs1LsI4vEAZE1QtoONtSrel34rYWOxNrOeA== X-Received: by 2002:a05:6a00:15ca:: with SMTP id o10mr8527224pfu.169.1594998392056; Fri, 17 Jul 2020 08:06:32 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y18sm8049184pff.10.2020.07.17.08.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2020 08:06:31 -0700 (PDT) Date: Fri, 17 Jul 2020 08:06:23 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: Robin Jarry , Louise Kilheeney , dev@dpdk.org, david.marchand@redhat.com Message-ID: <20200717080623.24ba9d1d@hermes.lan> In-Reply-To: <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> <20200717124209.GB708@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 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. 7. Change shebangs and keep the python2 compat imports 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. I would go for #0 for 20.08 and full python3 in 20.11 (#3)