From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id D126A38582A2; Mon, 4 Jul 2022 18:47:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D126A38582A2 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 879bfc586924cdaf42fc425fb71e7e145b8752a0 X-Git-Newrev: a8331e01fec619db68298b3760851c6180dea5cb Message-Id: <20220704184749.D126A38582A2@sourceware.org> Date: Mon, 4 Jul 2022 18:47:49 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 18:47:49 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=a8331e01fec619db68298b3760851c6180dea5cb commit a8331e01fec619db68298b3760851c6180dea5cb Author: Jon Turney Date: Mon Jul 4 19:47:35 2022 +0100 Update version to 20220704 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=91763a3f68af2db7c2b90f61926a75c33b1b8306 commit 91763a3f68af2db7c2b90f61926a75c33b1b8306 Author: Jon Turney Date: Mon Jul 4 19:00:52 2022 +0100 Make license_expression an optional dependency Diff: --- calm/hint.py | 28 ++++++++++++++++------------ setup.py | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/calm/hint.py b/calm/hint.py index 99408d7..d464bbc 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -27,19 +27,23 @@ from collections import OrderedDict import argparse -import license_expression import re -# reach inside license_expression to add custom license ids we permit -json = license_expression.get_license_index() -extra_licenses = [ - 'Linux-man-pages-copyleft', # requires SPDX license-list 3.15 - 'Public-Domain', - 'XVIEW', -] -for l in extra_licenses: - json.append({"spdx_license_key": l}) -licensing = license_expression.build_spdx_licensing(json) +try: + import license_expression +except ModuleNotFoundError: + licensing = None +else: + # reach inside license_expression to add custom license ids we permit + json = license_expression.get_license_index() + extra_licenses = [ + 'Linux-man-pages-copyleft', # requires SPDX license-list 3.15 + 'Public-Domain', + 'XVIEW', + ] + for l in extra_licenses: + json.append({"spdx_license_key": l}) + licensing = license_expression.build_spdx_licensing(json) # types of key: # 'multilineval' - always have a value, which may be multiline @@ -291,7 +295,7 @@ def hint_file_parse(fn, kind, strict=False): errors.append('message value must have id and text') # license must be a valid spdx license expression - if key == 'license': + if key == 'license' and licensing: try: le = licensing.validate(value, strict=True) except (license_expression.ExpressionParseError, license_expression.ExpressionError) as e: diff --git a/setup.py b/setup.py index 4afab46..338a9a7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name='calm', - version='20220627', + version='20220704', description='Cygwin packaging maintenance tool', long_description=open('README.md').read(), author='Jon Turney',