From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from btprdrgo007.btinternet.com (btprdrgo007.btinternet.com [65.20.50.168]) by sourceware.org (Postfix) with ESMTP id BB99C385DDF1 for ; Sun, 23 Jun 2024 14:26:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB99C385DDF1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB99C385DDF1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=65.20.50.168 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719152795; cv=none; b=SAkpm0tDu7apf1DybY9EWAG5fZjiirqW8VhOjgkmWuRdVOLdOu6Wi7dsXiS34k/ZKhkZ1+FtSC0wevRxJpOFqHu/VOiQwsiOk6otTq4qqwq/UqjnbfSW8agjF01Gez2YcgIjgZW6GtSZaj0O8AJahWJLFw7t9jMVLung0dBwUdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719152795; c=relaxed/simple; bh=9T5beGBcxCAPpOC99FJvkWG9Mcz0WCUnOfGcqPkd+AQ=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=Yri/8mlL9l9994ZBXfodjTzOi8TgIfCL7CdaTSBhGutU75v22svNBrhozcEG91HRn9b+nU9NmwUxRmPesW4rVNwt7vYFm1xr8UoHqobIwVTRgPq+insmTbb8r/9sXCct6MRSjBV0t0Qb1Nmas7ZxLg2wytPMZUhiJoA2suoexpw= ARC-Authentication-Results: i=1; server2.sourceware.org Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 666A0EF4009474F2 X-Originating-IP: [86.139.167.83] X-OWM-Source-IP: 86.139.167.83 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrfeefledgjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfevjggtgfesthekredttddvjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepiefhieffleefffetgeetheevueduieektdevgfejgeeiieefgeetkeekieetkeffnecuffhomhgrihhnpegthihgfihinhdrtghomhdpghhithhhuhgsrdgtohhmnecukfhppeekiedrudefledrudeijedrkeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddutdelngdpihhnvghtpeekiedrudefledrudeijedrkeefpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeeurhhirghnrdfknhhglhhishesufihshhtvghmrghtihgtufifrdgrsgdrtggrpdhrtghpthhtoheptgihghifihhnqdgrphhpshestgihghifihhnrdgtohhmpdhrvghvkffrpehhohhsthekiedqudefledqudeijedqkeefrdhrrghnghgvkeeiqddufeelrdgsthgtvghnthhrrghl phhluhhsrdgtohhmpdgruhhthhgpuhhsvghrpehjohhnthhurhhnvgihsegsthhinhhtvghrnhgvthdrtghomhdpghgvohfkrfepifeupdfovfetjfhoshhtpegsthhprhgurhhgohdttdej X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-VadeSecure-score: verdict=clean score=0/300, class=clean Received: from [192.168.1.109] (86.139.167.83) by btprdrgo007.btinternet.com (authenticated as jonturney@btinternet.com) id 666A0EF4009474F2; Sun, 23 Jun 2024 15:26:28 +0100 Message-ID: Date: Sun, 23 Jun 2024 15:26:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [ITP] python-license-expression and cygport PoC patch To: Brian Inglis References: From: Jon Turney Content-Language: en-US Cc: cygwin-apps@cygwin.com In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,BODY_8BITS,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 06/06/2024 20:03, Brian Inglis via Cygwin-apps wrote: > I found github/nexB/license-expression Python package to do SPDX licence > checks developed by the same team doing SPDX-toolkit for SPDX, using the > same current data, by and working with Fedora folks et al. Thanks for taking a look at this problem. Having a package for this seems fine, but: this package is what calm uses, and still has the drawbacks I mentioned: * embeds the SPDX license data, doesn't dynamically fetch it * can't really handle LicenseRef reasonably > > Successful attempt to package Python license-expression (without tests): > >     https://cygwin.com/cgi-bin2/jobs.cgi?id=8210 > > log at: > >     https://github.com/cygwin/scallywag/actions/runs/9293093201 > > cygport attached and at: > > https://cygwin.com/cgit/cygwin-packages/playground/commit/?id=3626386b10c967f780547d1703ad23bd50f6331a > > The package installs and runs using PoC attached in > spdx-license-expression.py script hooked into > /usr/share/cygport/lib/pkg_pkg.cygpart license hint addition patch > attached. I'm not super-keen on adding a cygport dependency on python, just to do this check. It would probably be preferable to do this check initially after the .cygport is read, rather than only telling you about problems when you get around to doing to the package step. > I also ran a test of the Python script and module against all package > source cygport files declaring licences which I maintain or ever looked > at, including a git/cygwin-packages/*.cygport download from 2023-02, > showing the results in the attached log. > I also attempted to trap the exceptions in the script, but that does not > seem to work in any documented obvious manner, but I do not know enough > Python to address this fully. Yeah, the way validate() handles parse errors is bizarre and unhelpful. What I ended up doing is calling parse() first to catch those errors, so something like: try: licensing.parse(expression) errs = licensing.validate(expression).errors except (ExpressionError, ExpressionParseError) as e: print(e, file=sys.stderr) return 2 > > If someone else who knows python cared to adopt and improve this in a > more normal manner, and incorporate this more smoothly into cygport, we > could all appreciate that. > Alternatively, some candid comments and frank feedback might allow me to > do so! ;^> >