diff --git a/CHANGELOG.md b/CHANGELOG.md index 13dfe85..631c1b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## CHANGELOG +### 3.5.1 + +* Fix the order in which multiple licenses are output + ### 3.5.0 * Handle multiple licenses better with options `--fail-on` and `--allow-only` diff --git a/dev-requirements.txt b/dev-requirements.txt index 03983d2..61c14f5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -34,7 +34,7 @@ docutils==0.17.1 # readme-renderer idna==2.10 # via requests -importlib-metadata==4.6.0 +importlib-metadata==4.6.1 # via # keyring # twine @@ -48,7 +48,7 @@ jeepney==0.6.0 # secretstorage keyring==23.0.1 # via twine -packaging==20.9 +packaging==21.0 # via # bleach # pytest @@ -109,7 +109,7 @@ toml==0.10.2 # pep517 # pytest # pytest-cov -tqdm==4.61.1 +tqdm==4.61.2 # via twine twine==3.4.1 # via -r dev-requirements.in diff --git a/piplicenses.py b/piplicenses.py index d8fc84d..f824263 100644 --- a/piplicenses.py +++ b/piplicenses.py @@ -61,7 +61,7 @@ open = open # allow monkey patching __pkgname__ = 'pip-licenses' -__version__ = '3.5.0' +__version__ = '3.5.1' __author__ = 'raimon' __license__ = 'MIT' __summary__ = ('Dump the software license list of ' @@ -248,7 +248,7 @@ def get_pkg_info(pkg): sys.stderr.write( "fail-on license {} was found for package " "{}:{}".format( - '; '.join(failed_licenses), + '; '.join(sorted(failed_licenses)), pkg_info['name'], pkg_info['version']) ) @@ -260,7 +260,7 @@ def get_pkg_info(pkg): sys.stderr.write( "license {} not in allow-only licenses was found" " for package {}:{}".format( - '; '.join(uncommon_licenses), + '; '.join(sorted(uncommon_licenses)), pkg_info['name'], pkg_info['version']) ) @@ -279,10 +279,10 @@ def create_licenses_table( if field == 'License': license_set = select_license_by_source( args.from_, pkg['license_classifier'], pkg['license']) - license_str = '; '.join(license_set) + license_str = '; '.join(sorted(license_set)) row.append(license_str) elif field == 'License-Classifier': - row.append('; '.join(pkg['license_classifier']) + row.append('; '.join(sorted(pkg['license_classifier'])) or LICENSE_UNKNOWN) elif field.lower() in pkg: row.append(pkg[field.lower()]) @@ -295,8 +295,8 @@ def create_licenses_table( def create_summary_table(args: "CustomNamespace"): counts = Counter( - '; '.join(select_license_by_source( - args.from_, pkg['license_classifier'], pkg['license'])) + '; '.join(sorted(select_license_by_source( + args.from_, pkg['license_classifier'], pkg['license']))) for pkg in get_packages(args)) table = factory_styled_table_with_args(args, SUMMARY_FIELD_NAMES)