Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752083AbeAEQGO convert rfc822-to-8bit (ORCPT + 1 other); Fri, 5 Jan 2018 11:06:14 -0500 Received: from smtp1.goneo.de ([85.220.129.30]:59236 "EHLO smtp1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784AbeAEQGM (ORCPT ); Fri, 5 Jan 2018 11:06:12 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH v3 1/1] runchecks: Generalize make C={1,2} to support multiple checkers From: Markus Heiser In-Reply-To: <87vagg8jjw.fsf@intel.com> Date: Fri, 5 Jan 2018 17:05:57 +0100 Cc: Jani Nikula , linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Nicolas Palix , Masahiro Yamada , John Haxby , Linux Doc Mailing List , Jonathan Corbet , Gilles Muller , Michal Marek , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , "Paul E. McKenney" , Julia Lawall , =?utf-8?Q?H=C3=A5kon_Bugge?= , =?utf-8?Q?=C3=85smund_=C3=98stvold?= , Matthew Wilcox , "Levin, Alexander (Sasha Levin)" , cocci@systeme.lip6.fr, linux-kbuild@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <3713CA61-B267-44FF-BF58-91F13CB4F915@darmarit.de> References: <5f292b7effba0efcf4855bff83b7b9313ac45895.1515072782.git-series.knut.omang@oracle.com> <874lo1aait.fsf@intel.com> <1515096931.31439.647.camel@oracle.com> <87vagg8jjw.fsf@intel.com> To: Knut Omang X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > Am 05.01.2018 um 15:30 schrieb Jani Nikula : > > On Thu, 04 Jan 2018, Knut Omang wrote: >> On Thu, 2018-01-04 at 17:50 +0200, Jani Nikula wrote: [...] >> Hmm - I have been burnt by the use of unstable interfaces in Python before, >> when I needed it to work on a (Linux) system with Python v.2.6.x only >> - argparse was introduced in v.2.7. and alternative choices are not >> at all clear to me, see for instance: >> >> https://dmerej.info/blog/post/docopt-v-argparse/ >> >> If this program was part of a "standalone" python project with a well defined python >> environment, I would probably have used argparse, which I have used in other projects. >> >> In fact I hesitated even to use python for this, because of fear of versioning issues.. >> When I was tempted anyway, and after looking at the existing examples in scripts/ >> ruling out python v.3.x, it felt safer to stay with the bare minimum of module >> features for this simple logic. >> >> I do feel confident that the benefits of python for this outweighs the drawbacks >> compared to my initial shell script implementation, or using perl or even C. >> >> Further advice on this appreciated, > > Again, I can only offer my opinion of requiring Python v2.7 and using > argparse, but it doesn't carry much weight. Up to the kbuild > maintainers. FYI: Py2.6 support has ended and Py2 expected to be end in 2020, the countdown is running ;) https://pythonclock.org/ If you wan't a command-line parser which is "builtin" use argparse, this is what I do mostly. If you are able to use requirements from outside use click [1]. For more infos read e.g. [2]. Docopt [3] has its charm but I would prefer the decorators from click. [1] http://click.pocoo.org/5/ [2] https://realpython.com/blog/python/comparing-python-command-line-parsing-libraries-argparse-docopt-click/ [3] https://github.com/docopt -- Markus --