Skip to content

Commit

Permalink
Merge pull request #62 from raimon49/release-2.1.0
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
raimon49 authored Jan 28, 2020
2 parents ac191c3 + ef15b00 commit 4a20276
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions piplicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4a20276

Please sign in to comment.