diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d45ead..66d3a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## CHANGELOG +### 2.1.0 + +* Implement new option `--format=plain-vertical` +* Support for outputting license file named `COPYING *` + ### 2.0.1 * Better license file open handling in Python 3 diff --git a/README.md b/README.md index 74deeea..ea5106a 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ When executed with the `--format=csv` option, you can output list in quoted CSV #### Plain Vertical When executed with the `--format=plain-vertical` option, you can output a simple plain vertical output that is similar to Angular CLI's -[`--extractLicenses` flag](https://angular.io/cli/build#options). This format minimizes rightward drift. +[--extractLicenses flag](https://angular.io/cli/build#options). This format minimizes rightward drift. ```bash (venv) $ pip-licenses --format=plain-vertical --with-license-file --no-license-path diff --git a/dev-requirements.txt b/dev-requirements.txt index afc7448..8a8fb6c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -38,7 +38,7 @@ twine==1.15.0 urllib3==1.25.8 # via requests wcwidth==0.1.8 # via pytest webencodings==0.5.1 # via bleach -wheel==0.34.0 +wheel==0.34.1 # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/piplicenses.py b/piplicenses.py index c199fb2..ea35aff 100644 --- a/piplicenses.py +++ b/piplicenses.py @@ -60,7 +60,7 @@ open = open # allow monkey patching __pkgname__ = 'pip-licenses' -__version__ = '2.0.1' +__version__ = '2.1.0' __author__ = 'raimon' __license__ = 'MIT License' __summary__ = ('Dump the software license list of ' @@ -135,8 +135,12 @@ def get_pkg_license_file(pkg): license_text = LICENSE_UNKNOWN pkg_dirname = "{}-{}.dist-info".format( pkg.project_name.replace("-", "_"), pkg.version) - license_file_base = os.path.join(pkg.location, pkg_dirname, 'LICENSE*') - for test_file in glob.glob(license_file_base): + file_names = ('LICENSE*', 'COPYING*') + patterns = [] + [patterns.extend(glob.glob(os.path.join(pkg.location, + pkg_dirname, + f))) for f in file_names] + for test_file in patterns: if os.path.exists(test_file): license_file = test_file with open(test_file, encoding='utf-8') as license_file_handle: