Skip to content

Commit

Permalink
Merge pull request #54 from raimon49/release-2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
raimon49 authored Jan 3, 2020
2 parents 91969a8 + 1aece17 commit caca390
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 149 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
dist: xenial
language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
install:
- pip install -r dev-requirements.txt
script:
pytest --pep8 -v --cov
pytest --pycodestyle -v --cov
after_success:
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then codecov; fi
- if [[ $TRAVIS_PYTHON_VERSION == "3.8" ]]; then codecov; fi
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
## CHANGELOG

### 2.0.0

* Dropped support Python 2.7
* Breaking changes
* Removed migration path to obsolete options
* `--from-classifier`
* `--format-markdown`
* `--format-rst`
* `--format-confluence`
* `--format-html`
* `--format-json`
* Implement new option `--no-license-path`

### 1.18.0

* Supports compatibility to work with either PTable or prettytable
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The design policy of `pip-licenses` is as follows.

* Focus only on outputting license information of Python packages installed in user's environment.
* Supports both Python 2.7 and 3.5 or later.
* Support Python 3.5 or later.
* External packages that depend on runtime are [PTable](https://pypi.org/project/PTable/) only.
* Expect that pip and setuptools are implicitly installed.

Expand Down
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Dump the software license list of Python packages installed with pip.
* [Usage](#usage)
* [Command\-Line Options](#command-line-options)
* [Option: from](#option-from)
* [Deprecated from\-classifier](#deprecated-from-classifier)
* [Option: with\-system](#option-with-system)
* [Option: with\-authors](#option-with-authors)
* [Option: with\-urls](#option-with-urls)
Expand All @@ -27,7 +26,6 @@ Dump the software license list of Python packages installed with pip.
* [JSON](#json)
* [JSON LicenseFinder](#json-licensefinder)
* [CSV](#csv)
* [Deprecated options](#deprecated-options)
* [Option: summary](#option-summary)
* [Option: output\-file](#option-output-file)
* [More Information](#more-information)
Expand Down Expand Up @@ -55,6 +53,12 @@ Install it via PyPI using `pip` command.
$ pip install -U pip-licenses
```

**Note:** If you are still using Python 2.7, install version less than 2.0. No new features will be provided for version 1.x.

```bash
$ pip install 'pip-licenses<2.0'
```

## Usage

Execute the command with your venv (or virtualenv) environment.
Expand Down Expand Up @@ -108,10 +112,6 @@ In mixed mode, it first tries to look for licenses in the Classifiers. When not
* The `c` keyword is prepared as alias of `classifier`.
* The `mix` keyword is prepared as alias of `mixed`.

#### Deprecated from-classifier

`from-classifier` option will be deprecated in version 2.0.0. Please migrate to `--from` option.

### Option: with-system

By default, system packages such as `pip` and `setuptools` are ignored.
Expand Down Expand Up @@ -166,6 +166,7 @@ When executed with the `--with-description` option, output with short descriptio

When executed with the `--with-license-file` option, output the location of the package's license file on disk and the full contents of that file. Due to the length of these fields, this option is best paired with `--format=json`.

**Note:** If you want to keep the license file path secret, specify `--no-license-path` option together.

### Option: ignore-packages

Expand Down Expand Up @@ -327,16 +328,6 @@ When executed with the `--format=csv` option, you can output list in quoted CSV
"pytz","2017.3","MIT"
```

#### Deprecated options

The following options will be deprecated in version 2.0.0. Please migrate to `--format` option.

* `--format-markdown`
* `--format-rst`
* `--format-confluence`
* `--format-html`
* `--format-json`

### Option: summary

When executed with the `--summary` option, you can output a summary of each license.
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ wheel
pip-tools
pypandoc
pytest-cov
pytest-pycodestyle~=1.0.6 # Pinned for Python 2.7
pytest-pycodestyle
pytest-runner
twine
twine<2 # Pinned for Python 3.5
33 changes: 11 additions & 22 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,42 @@
#
# pip-compile dev-requirements.in
#
apipkg==1.5 # via execnet
atomicwrites==1.3.0 # via pytest
attrs==19.3.0 # via pytest
autopep8==1.4.4
bleach==3.1.0 # via readme-renderer
certifi==2019.11.28 # via requests
chardet==3.0.4 # via requests
click==7.0 # via pip-tools
codecov==2.0.15
configparser==4.0.2 # via importlib-metadata
contextlib2==0.6.0.post1 # via importlib-metadata
coverage==4.5.4 # via codecov, pytest-cov
coverage==5.0.1 # via codecov, pytest-cov
docutils==0.15.2
execnet==1.7.1 # via pytest-cache
funcsigs==1.0.2 # via pytest
idna==2.8 # via requests
importlib-metadata==1.3.0 # via pluggy, pytest
more-itertools==5.0.0 # via pytest, zipp
more-itertools==8.0.2 # via pytest
packaging==19.2 # via pytest
pathlib2==2.3.5 # via importlib-metadata, pytest
pip-tools==4.3.0
pkginfo==1.5.0.1 # via twine
pluggy==0.13.1 # via pytest
ptable==0.9.2
py==1.8.0 # via pytest
py==1.8.1 # via pytest
pycodestyle==2.5.0 # via autopep8, pytest-pycodestyle
pygments==2.5.2 # via readme-renderer
pypandoc==1.4
pyparsing==2.4.5 # via packaging
pytest-cache==1.0 # via pytest-pycodestyle
pyparsing==2.4.6 # via packaging
pytest-cov==2.8.1
pytest-pycodestyle==1.0.6
pytest-pycodestyle==2.0.0
pytest-runner==5.2
pytest==4.6.7 # via pytest-cache, pytest-cov, pytest-pycodestyle
pytest==5.3.2 # via pytest-cov, pytest-pycodestyle
readme-renderer==24.0 # via twine
requests-toolbelt==0.9.1 # via twine
requests==2.22.0 # via codecov, requests-toolbelt, twine
scandir==1.10.0 # via pathlib2
six==1.13.0 # via bleach, more-itertools, packaging, pathlib2, pip-tools, pytest, readme-renderer
tqdm==4.40.2 # via twine
six==1.13.0 # via bleach, packaging, pip-tools, readme-renderer
tqdm==4.41.1 # via twine
twine==1.15.0
urllib3==1.25.7 # via requests
wcwidth==0.1.7 # via pytest
wcwidth==0.1.8 # via pytest
webencodings==0.5.1 # via bleach
wheel==0.33.6
zipp==0.6.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip==19.3.1 # via pypandoc
# setuptools==42.0.2 # via pypandoc, twine
# pip
# setuptools
64 changes: 10 additions & 54 deletions piplicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import (division, print_function,
absolute_import, unicode_literals)
import sys
import glob
import os
Expand All @@ -39,7 +37,7 @@

try:
from pip._internal.utils.misc import get_installed_distributions
except ImportError:
except ImportError: # pragma: no cover
from pip import get_installed_distributions
from prettytable import PrettyTable
try:
Expand All @@ -60,7 +58,7 @@
PTABLE = False

__pkgname__ = 'pip-licenses'
__version__ = '1.18.0'
__version__ = '2.0.0'
__author__ = 'raimon'
__license__ = 'MIT License'
__summary__ = ('Dump the software license list of '
Expand Down Expand Up @@ -406,7 +404,9 @@ def get_output_fields(args):
output_fields.append('Description')

if args.with_license_file:
output_fields.append('LicenseFile')
if not args.no_license_path:
output_fields.append('LicenseFile')

output_fields.append('LicenseText')

return output_fields
Expand Down Expand Up @@ -459,17 +459,6 @@ def create_warn_string(args):
'will be ignored.'))
warn_messages.append(message)

if args.from_classifier:
message = warn(('The option "--from-classifier" is deprecated. '
'Please migrate to "--from=classifier".'))
warn_messages.append(message)

if (args.format_markdown or args.format_rst or args.format_confluence or
args.format_html or args.format_json):
message = warn(('The option "--format-xxx" is deprecated. '
'Please migrate to "--format=xxx".'))
warn_messages.append(message)

return '\n'.join(warn_messages)


Expand Down Expand Up @@ -536,20 +525,6 @@ def _compatible_format_args(self, args):
if format_input in ('csv', ):
args.format = 'csv'

if args.from_classifier:
setattr(args, 'from', 'classifier')

if args.format_markdown:
args.format = 'markdown'
elif args.format_rst:
args.format = 'rst'
elif args.format_confluence:
args.format = 'confluence'
elif args.format_html:
args.format = 'html'
elif args.format_json:
args.format = 'json'


def create_parser():
parser = CompatibleArgumentParser(
Expand All @@ -563,10 +538,6 @@ def create_parser():
help=('where to find license information\n'
'"meta", "classifier, "mixed"\n'
'default: --from=meta'))
parser.add_argument('-c', '--from-classifier',
action='store_true',
default=False,
help='find license from classifier')
parser.add_argument('-s', '--with-system',
action='store_true',
default=False,
Expand All @@ -588,6 +559,11 @@ def create_parser():
default=False,
help='dump with location of license file and '
'contents, most useful with JSON output')
parser.add_argument('--no-license-path',
action='store_true',
default=False,
help='when specified together with option -l, '
'suppress location of license file output')
parser.add_argument('-i', '--ignore-packages',
action='store', type=str,
nargs='+', metavar='PKG',
Expand All @@ -606,26 +582,6 @@ def create_parser():
'"plain", "markdown", "rst", "confluence",\n'
'"html", "json", "json-license-finder", "csv"\n'
'default: --format=plain'))
parser.add_argument('-m', '--format-markdown',
action='store_true',
default=False,
help='dump as markdown style')
parser.add_argument('-r', '--format-rst',
action='store_true',
default=False,
help='dump as reST style')
parser.add_argument('--format-confluence',
action='store_true',
default=False,
help='dump as confluence wiki style')
parser.add_argument('--format-html',
action='store_true',
default=False,
help='dump as html style')
parser.add_argument('--format-json',
action='store_true',
default=False,
help='dump as json')
parser.add_argument('--summary',
action='store_true',
default=False,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements.txt requirements.in
# pip-compile requirements.in
#
ptable==0.9.2
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ universal=1
[aliases]
test=pytest
[tool:pytest]
addopts=--pep8 -v --cov --cov-report term-missing
addopts=--pycodestyle -v --cov --cov-report term-missing
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def read_file(filename):
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand All @@ -91,7 +89,7 @@ def read_file(filename):
keywords='pip pypi package license check',
py_modules=['piplicenses'],
license=LICENSE,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
python_requires='~=3.5',
install_requires=['PTable'],
setup_requires=[
'pytest-runner',
Expand Down
Loading

0 comments on commit caca390

Please sign in to comment.