From 2d9a60ea051c0c132169282aff1072e8bd63a3f4 Mon Sep 17 00:00:00 2001 From: Michael Aden Date: Wed, 18 Sep 2024 17:20:34 -0500 Subject: [PATCH 1/2] Update license cases for updated versions. Signed-off-by: Michael Aden --- src/malloy/utils/third_party_licenses.py | 38 +++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/malloy/utils/third_party_licenses.py b/src/malloy/utils/third_party_licenses.py index 2815f6c..b248b16 100644 --- a/src/malloy/utils/third_party_licenses.py +++ b/src/malloy/utils/third_party_licenses.py @@ -52,6 +52,9 @@ 'argon2-cffi-bindings': { METADATA_LICENSE_FILE: 'LICENSE' }, + 'backports-tarfile': { + METADATA_NAME: 'backports.tarfile' + }, 'docutils': { METADATA_LICENSE_FILE: 'COPYING.txt' }, @@ -90,6 +93,12 @@ 'jaraco-classes': { METADATA_NAME: 'jaraco.classes' }, + 'jaraco-context': { + METADATA_NAME: 'jaraco.context' + }, + 'jaraco-functools': { + METADATA_NAME: 'jaraco.functools' + }, 'jeepney': { METADATA_LICENSE_FILE: 'LICENSE' }, @@ -139,12 +148,25 @@ 'pickleshare': { METADATA_LICENSE_FILE: 'LICENSE' }, + 'prompt-toolkit': { + METADATA_NAME: 'prompt_toolkit' + }, + 'pure-eval': { + METADATA_NAME: 'pure_eval' + }, 'pyproject-hooks': { - METADATA_NAME: 'pyproject_hooks' + METADATA_NAME: 'pyproject_hooks', + METADATA_LICENSE_FILE: 'LICENSE' + }, + 'pyasn1-modules': { + METADATA_NAME: 'pyasn1_modules' }, 'pytest-notebook': { METADATA_NAME: 'pytest_notebook' }, + 'pyzmq': { + METADATA_LICENSE_FILE: 'LICENSE.md' + }, 'readme-renderer': { METADATA_NAME: 'readme_renderer', METADATA_URL: 'https://github.com/pypa/readme_renderer', @@ -192,7 +214,7 @@ def extract_project_url(raw_input): match = re.match('^(.+)?(https?:/(/[^/]+)(/[^/]+)(/[^/]+))/?(.+)?$', raw_input) if match is None: - print(f'ERROR: failed to extract project url: {raw_input}') + print(f'WARN: failed to extract project url: {raw_input}') return None url = (f'https:/{match.group(3)}' f'{match.group(4)}{match.group(5).removesuffix(".git")}') @@ -254,7 +276,7 @@ def find_license(req): license_txt = request.text if license_txt is None: - print(f'ERROR: License file not found: {req}') + print(f'WARN: License file not found: {req}') return license_txt @@ -267,7 +289,7 @@ def get_metadata(req): # print('dist.metadata["Name"]=' + dist.metadata.get('Name')) dist_name = dist.metadata.get('Name') if dist_name is None: - print('Error: name not included in metadata') + print('WARN: name not included in metadata') continue dist_name = dist_name.lower() @@ -320,7 +342,7 @@ def get_metadata(req): license_types.append(value) if not found: - print('Error: ' + req[METADATA_NAME] + ' not found') + print('WARN: ' + req[METADATA_NAME] + ' not found') req[METADATA_LICENSE_TYPES] = license_types return req @@ -365,20 +387,20 @@ def validate_data(requirements): for key in requirements: if requirements[key].get(METADATA_LICENSE) is None: issue_found = True - print(f'ERROR: License not found for {key}\n {requirements[key]}') + print(f'WARN: License not found for {key}\n {requirements[key]}') license_types = requirements[key].get(METADATA_LICENSE_TYPES) if license_types is None or len(license_types) < 1: issue_found = True print( - f'ERROR: Licence type not classified for {key}\n {requirements[key]}' + f'WARN: Licence type not classified for {key}\n {requirements[key]}' ) if issue_found: # Python dependencies are not packaged/distributed by us # re-add failure if this changes # raise AssertionError('ERROR: License data validation failed') - print('WARNING: issue(s) found with python license information') + print('WARN: issue(s) found with python license information') def gen_requirements_file(path=f'src/malloy/utils/{THIRD_PARTY_FILENAME}'): From 9c3eb642edb9fe9505b92706ce28bb836683ce2d Mon Sep 17 00:00:00 2001 From: Michael Aden Date: Wed, 18 Sep 2024 17:27:11 -0500 Subject: [PATCH 2/2] Lint issues run yapf Signed-off-by: Michael Aden --- src/malloy/utils/third_party_licenses.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/malloy/utils/third_party_licenses.py b/src/malloy/utils/third_party_licenses.py index b248b16..068b5bd 100644 --- a/src/malloy/utils/third_party_licenses.py +++ b/src/malloy/utils/third_party_licenses.py @@ -393,8 +393,7 @@ def validate_data(requirements): if license_types is None or len(license_types) < 1: issue_found = True print( - f'WARN: Licence type not classified for {key}\n {requirements[key]}' - ) + f'WARN: Licence type not classified for {key}\n {requirements[key]}') if issue_found: # Python dependencies are not packaged/distributed by us