Skip to content

Commit

Permalink
Merge pull request #25 from raimon49/release-1.12.0
Browse files Browse the repository at this point in the history
Release 1.12.0
  • Loading branch information
raimon49 authored Feb 27, 2019
2 parents 0a3a1c8 + 33e2a6e commit 18a8e4a
Show file tree
Hide file tree
Showing 8 changed files with 325 additions and 44 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,7 @@ ENV/

# mypy
.mypy_cache/

# ignore files to run in docker
docker/*
!docker/.gitkeep
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## CHANGELOG

### 1.12.0

* Supports execution within Docker container
* Warning of deprecated options
* Fix bug
* Ignore `OSI Approved` string with multiple licenses

### 1.11.0

* Implement new option `--with-license-file`
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.7.2-alpine
LABEL maintainer="raimon <[email protected]>"

WORKDIR /opt/piplicenses

COPY ./docker/requirements.txt /opt/piplicenses

RUN python3 -m venv /opt/piplicenses/myapp \
&& source /opt/piplicenses/myapp/bin/activate
RUN pip3 install -U pip \
&& pip3 install -r /opt/piplicenses/requirements.txt \
&& pip3 install -U pip-licenses

ENTRYPOINT ["pip-licenses"]
CMD ["--from-classifier"]
92 changes: 72 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ Dump the software license list of Python packages installed with pip.
* [Option: with\-license\-file](#option-with-license-file)
* [Option: ignore\-packages](#option-ignore-packages)
* [Option: order](#option-order)
* [Option: format\-markdown](#option-format-markdown)
* [Option: format\-rst](#option-format-rst)
* [Option: format\-confluence](#option-format-confluence)
* [Option: format\-html](#option-format-html)
* [Option: format\-json](#option-format-json)
* [Option: format](#option-format)
* [Markdown](#markdown)
* [reST](#rest)
* [Confluence](#confluence)
* [HTML](#html)
* [json](#json)
* [Deprecated options](#deprecated-options)
* [Option: summary](#option-summary)
* [More Information](#more-information)
* [Dockerfile](#dockerfile)
* [License](#license)
* [Dependencies](#dependencies)
* [Uninstallation](#uninstallation)
Expand Down Expand Up @@ -181,12 +184,16 @@ If you give arguments to the `--order` option, you can output in other sorted or
(venv) $ pip-licenses --order=license
```

### Option: format-markdown
### Option: format

When executed with the `--format-markdown` option, you can output list in markdown format.
By default, it is output to the `plain` format.

#### Markdown

When executed with the `--format=markdown` option, you can output list in markdown format. The `m` `md` keyword is prepared as alias of `markdown`.

```bash
(venv) $ pip-licenses --format-markdown
(venv) $ pip-licenses --format=markdown
| Name | Version | License |
|--------|---------|---------|
| Django | 2.0.2 | BSD |
Expand All @@ -200,12 +207,12 @@ When inserted in a markdown document, it is rendered as follows:
| Django | 2.0.2 | BSD |
| pytz | 2017.3 | MIT |

### Option: format-rst
#### reST

When executed with the `--format-rst` option, you can output list in "[Grid tables](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables)" of reStructuredText format.
When executed with the `--format=rst` option, you can output list in "[Grid tables](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables)" of reStructuredText format. The `r` `rest` keyword is prepared as alias of `rst`.

```bash
(venv) $ pip-licenses --format-rst
(venv) $ pip-licenses --format=rst
+--------+---------+---------+
| Name | Version | License |
+--------+---------+---------+
Expand All @@ -215,23 +222,23 @@ When executed with the `--format-rst` option, you can output list in "[Grid tabl
+--------+---------+---------+
```

### Option: format-confluence
#### Confluence

When executed with the `--format-confluence` option, you can output list in Confluence (or JIRA) Wiki markup format.
When executed with the `--format=confluence` option, you can output list in Confluence (or JIRA) Wiki markup format. The `c` keyword is prepared as alias of `confluence`.

```bash
(venv) $ pip-licenses --format-confluence
(venv) $ pip-licenses --format=confluence
| Name | Version | License |
| Django | 2.0.2 | BSD |
| pytz | 2017.3 | MIT |
```

### Option: format-html
#### HTML

When executed with the `--format-html` option, you can output list in HTML table format.
When executed with the `--format=html` option, you can output list in HTML table format. The `h` keyword is prepared as alias of `html`.

```bash
(venv) $ pip-licenses --format-html
(venv) $ pip-licenses --format=html
<table>
<tr>
<th>Name</th>
Expand All @@ -251,10 +258,9 @@ When executed with the `--format-html` option, you can output list in HTML table
</table>
```

### Option: format-json
#### json

When executed with the `--format-json` option, you can output list in JSON format
easily allowing post-processing
When executed with the `--format-json` option, you can output list in JSON format easily allowing post-processing. The `j` keyword is prepared as alias of `json`.

```json
[
Expand All @@ -276,6 +282,16 @@ easily allowing post-processing

```

#### 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 All @@ -293,6 +309,42 @@ When executed with the `--summary` option, you can output a summary of each lice

Other, please make sure to execute the `--help` option.

## Dockerfile

You can check the package license used by your app in the isolated Docker environment.

```bash
# Clone this repository to local
$ git clone https://github.com/raimon49/pip-licenses.git
$ cd pip-licenses

# Create your app's requirements.txt file
# Other ways, pip freeze > docker/requirements.txt
$ echo "Flask" > docker/requirements.txt

# Build docker image
$ docker build . -t myapp-licenses

# Check the package license in container
$ docker run --rm myapp-licenses
Name Version License
Click 7.0 BSD License
Flask 1.0.2 BSD License
Jinja2 2.10 BSD License
MarkupSafe 1.1.1 BSD License
Werkzeug 0.14.1 BSD License
itsdangerous 1.1.0 BSD License

# Check with options
$ docker run --rm myapp-licenses --summary
Count License
5 BSD
1 BSD-3-Clause

# When you need help
$ docker run --rm myapp-licenses --help
```

## License

[MIT License](https://github.com/raimon49/pip-licenses/blob/master/LICENSE)
Expand Down
10 changes: 5 additions & 5 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ funcsigs==1.0.2 # via pytest
idna==2.8 # via requests
more-itertools==5.0.0 # via pytest
pathlib2==2.3.3 # via pytest
pip-tools==3.3.2
pip-tools==3.4.0
pkginfo==1.5.0.1 # via twine
pluggy==0.8.1 # via pytest
pluggy==0.9.0 # via pytest
ptable==0.9.2
py==1.7.0 # via pytest
py==1.8.0 # via pytest
pycodestyle==2.5.0 # via autopep8, pytest-pycodestyle
pygments==2.3.1 # via readme-renderer
pypandoc==1.4
pytest-cache==1.0 # via pytest-pycodestyle
pytest-cov==2.6.1
pytest-pycodestyle==1.0.6
pytest-runner==4.4
pytest==4.2.1 # via pytest-cache, pytest-cov, pytest-pycodestyle
pytest==4.3.0 # via pytest-cache, pytest-cov, pytest-pycodestyle
readme-renderer==24.0 # via twine
requests-toolbelt==0.9.1 # via twine
requests==2.21.0 # via codecov, requests-toolbelt, twine
Expand All @@ -42,4 +42,4 @@ tqdm==4.31.1 # via twine
twine==1.13.0
urllib3==1.24.1 # via requests
webencodings==0.5.1 # via bleach
wheel==0.33.0
wheel==0.33.1
Empty file added docker/.gitkeep
Empty file.
Loading

0 comments on commit 18a8e4a

Please sign in to comment.