Skip to content

Commit

Permalink
Merge pull request #10 from raimon49/support-pip10
Browse files Browse the repository at this point in the history
Supports both pip 9.x and pip 10.x
  • Loading branch information
raimon49 authored Apr 19, 2018
2 parents 7cb72ea + 79e29dc commit 8d6ceb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## CHANGELOG

### 1.7.1

* Fix bug
* Support pip 10.x

### 1.7.0

* Implement new option `--format-confluence`
Expand Down
9 changes: 6 additions & 3 deletions piplicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
from email.parser import FeedParser
from email import message_from_string

import pip
try:
from pip._internal.utils.misc import get_installed_distributions
except ImportError:
from pip import get_installed_distributions
from prettytable import PrettyTable
from prettytable.prettytable import (FRAME as RULE_FRAME, ALL as RULE_ALL,
HEADER as RULE_HEADER, NONE as RULE_NONE)

__pkgname__ = 'pip-licenses'
__version__ = '1.7.0'
__version__ = '1.7.1'
__author__ = 'raimon'
__license__ = 'MIT License'
__summary__ = ('Dump the software license list of '
Expand Down Expand Up @@ -116,7 +119,7 @@ def get_pkg_info(pkg):

table = factory_styled_table_with_args(args)

pkgs = pip.get_installed_distributions()
pkgs = get_installed_distributions()
ignore_pkgs_as_lower = [pkg.lower() for pkg in args.ignore_packages]
for pkg in pkgs:
pkg_info = get_pkg_info(pkg)
Expand Down

0 comments on commit 8d6ceb4

Please sign in to comment.