public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704
Date: Mon,  4 Jul 2022 18:47:49 +0000 (GMT)	[thread overview]
Message-ID: <20220704184749.D126A38582A2@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=a8331e01fec619db68298b3760851c6180dea5cb

commit a8331e01fec619db68298b3760851c6180dea5cb
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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',



                 reply	other threads:[~2022-07-04 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704184749.D126A38582A2@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).