Skip to content

Commit 393fdf8

Browse files
committed
2021.5
1 parent c3beead commit 393fdf8

File tree

11 files changed

+216
-261
lines changed

11 files changed

+216
-261
lines changed

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
- repo: https://github.com/FHPythonUtils/Blackt
3+
rev: '2021'
4+
hooks:
5+
- id: blackt
6+
7+
- repo: https://github.com/pycqa/isort
8+
rev: 5.9.3
9+
hooks:
10+
- id: isort
11+
12+
- repo: https://github.com/pycqa/pylint
13+
rev: v2.11.1
14+
hooks:
15+
- id: pylint
16+
args: [--disable=import-error,--jobs=0, --fail-under=9.8]
17+
18+
- repo: https://github.com/pre-commit/pre-commit-hooks
19+
rev: v4.0.1
20+
hooks:
21+
- id: trailing-whitespace
22+
- id: end-of-file-fixer
23+
24+
- repo: https://github.com/asottile/pyupgrade
25+
rev: v2.29.0
26+
hooks:
27+
- id: pyupgrade
28+
args: [--py37-plus]

CHANGELOG.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,85 @@
22
All major and minor version changes will be documented in this file. Details of
33
patch-level version changes can be found in [commit messages](../../commits/master).
44

5+
## 2021.5 - 2021/10/18
6+
7+
- Compatible with pip 21.3
8+
- Code quality improvements
9+
510
## 2021.5 - 2021/09/14
11+
612
- Add `-u poetry:dev` to command-line to include dev packages (excluded by default) per https://github.com/FHPythonUtils/LicenseCheck/issues/16
713
- Add support for proprietary license per https://github.com/FHPythonUtils/LicenseCheck/issues/15
814
- Raise RuntimeError if missing license and classifier https://github.com/FHPythonUtils/LicenseCheck/issues/14
915
- Quality improvements to license_matrix.py
1016
- Add additional examples to readme
1117
- Support pre-commit-hooks https://github.com/FHPythonUtils/LicenseCheck/issues/8
1218

13-
1419
## 2021.4.1 - 2021/09/07
20+
1521
- Command-line options take precedent over config options as expected
1622

1723
## 2021.4 - 2021/09/07
24+
1825
- Add config file functionality per https://github.com/FHPythonUtils/LicenseCheck/issues/11
19-
- Parsed in the following order: `pyproject.toml`, `setup.cfg`, `licensecheck.toml`, `licensecheck.json`, `licensecheck.ini`, `~/licensecheck.toml`, `~/licensecheck.json`, `~/licensecheck.ini`
20-
- Note that the config takes precedent over command-line options
26+
- Parsed in the following order: `pyproject.toml`, `setup.cfg`, `licensecheck.toml`, `licensecheck.json`, `licensecheck.ini`, `~/licensecheck.toml`, `~/licensecheck.json`, `~/licensecheck.ini`
27+
- Note that the config takes precedent over command-line options
2128
- Add optional path to requirements.txt as outlined in https://github.com/FHPythonUtils/LicenseCheck/issues/9#issuecomment-898878228
22-
- Eg. `licensecheck --using requirements:c:/path/to/reqs.txt;path/to/other/reqs.txt`
29+
- Eg. `licensecheck --using requirements:c:/path/to/reqs.txt;path/to/other/reqs.txt`
2330

2431
## 2021.3 - 2021/08/13
32+
2533
- Add `--ignore-packages`, `--fail-packages`,`--ignore-licenses`, `--fail-licenses`, per https://github.com/FHPythonUtils/LicenseCheck/issues/7
2634
- Fix spelling
2735
- Added a couple examples to the readme
2836
- Added pylintrc to pyproject.toml
2937

30-
3138
## 2021.2 - 2021/08/13
39+
3240
- Added ability to use requirements.txt per https://github.com/FHPythonUtils/LicenseCheck/issues/6
3341
- Code clean-up + refactoring
3442
- Fix spelling
3543
- packagecompat.py → types.py as this module holds types + typing info
3644

3745
## 2021.1.2 - 2021/06/07
46+
3847
- reformat
3948
- improve docstrings
4049

4150
## 2021.1.1 - 2021/03/01
51+
4252
- Add PSFL to matrix.
4353

4454
## 2021.1 - 2021/03/01
55+
4556
- Tidied up
4657
- Added `--zero/-0` flag to return non-zero exit code when an incompatible
47-
license is found
58+
license is found
4859

4960
## 2021 - 2021/01/24
61+
5062
- Updated requirements
5163
- Fallback to requirements.txt when poetry throws an error and direct the user
52-
to troubleshoot
64+
to troubleshoot
5365

5466
## 2020.0.4 - 2020/10/14
67+
5568
- Improved support for GPL fans out there by detecting variants in a more
56-
granular manner. Fewer false -ves for said GPL variants. E.g. a dependency with
57-
GPL2 only will be flagged for a project using GPL3
69+
granular manner. Fewer false -ves for said GPL variants. E.g. a dependency with
70+
GPL2 only will be flagged for a project using GPL3
5871

5972
## 2020.0.3 - 2020/10/12
73+
6074
- set stdout to utf-8
6175

6276
## 2020.0.2 - 2020/10/12
77+
6378
- fancy tables in simple and ansi formats
6479

6580
## 2020.0.1 - 2020/10/11
81+
6682
- dependencies bugfix
6783

6884
## 2020 - 2020/10/09
85+
6986
- First release

DOCS/licensecheck/formatter.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ Formats
3333

3434
## ansi
3535

36-
[[find in source code]](../../licensecheck/formatter.py#L142)
36+
[[find in source code]](../../licensecheck/formatter.py#L141)
3737

3838
```python
39-
def ansi(
40-
packages: list[PackageCompat],
41-
heading: typing.Optional[str] = None,
42-
) -> str:
39+
def ansi(packages: list[PackageCompat], heading: str | None = None) -> str:
4340
```
4441

4542
Format to ansi.
@@ -55,13 +52,10 @@ Format to ansi.
5552

5653
## csv
5754

58-
[[find in source code]](../../licensecheck/formatter.py#L100)
55+
[[find in source code]](../../licensecheck/formatter.py#L99)
5956

6057
```python
61-
def csv(
62-
packages: list[PackageCompat],
63-
heading: typing.Optional[str] = None,
64-
) -> str:
58+
def csv(packages: list[PackageCompat], heading: str | None = None) -> str:
6559
```
6660

6761
Format to CSV.
@@ -77,13 +71,10 @@ Format to CSV.
7771

7872
## json
7973

80-
[[find in source code]](../../licensecheck/formatter.py#L80)
74+
[[find in source code]](../../licensecheck/formatter.py#L79)
8175

8276
```python
83-
def json(
84-
packages: list[PackageCompat],
85-
heading: typing.Optional[str] = None,
86-
) -> str:
77+
def json(packages: list[PackageCompat], heading: str | None = None) -> str:
8778
```
8879

8980
Format to Json.
@@ -99,12 +90,12 @@ Format to Json.
9990

10091
## markdown
10192

102-
[[find in source code]](../../licensecheck/formatter.py#L41)
93+
[[find in source code]](../../licensecheck/formatter.py#L40)
10394

10495
```python
10596
def markdown(
10697
packages: list[PackageCompat],
107-
heading: typing.Optional[str] = None,
98+
heading: str | None = None,
10899
) -> str:
109100
```
110101

@@ -121,7 +112,7 @@ Format to Markdown.
121112

122113
## simple
123114

124-
[[find in source code]](../../licensecheck/formatter.py#L195)
115+
[[find in source code]](../../licensecheck/formatter.py#L194)
125116

126117
```python
127118
def simple(packages: list[PackageCompat]) -> str:

DOCS/licensecheck/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
> Auto-generated documentation for [licensecheck](../../licensecheck/__init__.py) module.
44
5-
Output the licenses used by dependencies and check if these are compatible with the project license.
5+
Output the licenses used by dependencies and check if these are compatible with the project
6+
license.
67

78
- [Licensecheck](../README.md#licensecheck-index) / [Modules](../README.md#licensecheck-modules) / licensecheck
89
- [cli](#cli)
@@ -16,7 +17,7 @@ Output the licenses used by dependencies and check if these are compatible with
1617

1718
## cli
1819

19-
[[find in source code]](../../licensecheck/__init__.py#L17)
20+
[[find in source code]](../../licensecheck/__init__.py#L18)
2021

2122
```python
2223
def cli() -> None:

DOCS/licensecheck/packageinfo.md

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,34 @@
55
Get information for installed and online packages.
66

77
- [Licensecheck](../README.md#licensecheck-index) / [Modules](../README.md#licensecheck-modules) / [licensecheck](index.md#licensecheck) / packageinfo
8-
- [calcContainer](#calccontainer)
98
- [getModuleSize](#getmodulesize)
109
- [getMyPackageLicense](#getmypackagelicense)
1110
- [getPackages](#getpackages)
1211
- [getPackagesFromLocal](#getpackagesfromlocal)
13-
- [getPackagesFromOnline](#getpackagesfromonline)
14-
- [licenseFromClassifierMessage](#licensefromclassifiermessage)
1512
- [licenseFromClassifierlist](#licensefromclassifierlist)
16-
17-
## calcContainer
18-
19-
[[find in source code]](../../licensecheck/packageinfo.py#L204)
20-
21-
```python
22-
def calcContainer(path: str) -> int:
23-
```
24-
25-
Get size of installed module from path.
26-
27-
#### Arguments
28-
29-
- `path` *str* - path to the module
30-
31-
#### Returns
32-
33-
- `int` - size in bytes
13+
- [packageInfoFromPypi](#packageinfofrompypi)
3414

3515
## getModuleSize
3616

37-
[[find in source code]](../../licensecheck/packageinfo.py#L221)
17+
[[find in source code]](../../licensecheck/packageinfo.py#L153)
3818

3919
```python
40-
def getModuleSize(pkg: Distribution) -> int:
20+
def getModuleSize(pkg: BaseDistribution) -> int:
4121
```
4222

4323
Get the size of a given module as an int.
4424

4525
#### Arguments
4626

47-
- `pkg` *Distribution* - package to get the size of
27+
- `pkg` *BaseDistribution* - package to get the size of
4828

4929
#### Returns
5030

5131
- `int` - size in bytes
5232

5333
## getMyPackageLicense
5434

55-
[[find in source code]](../../licensecheck/packageinfo.py#L168)
35+
[[find in source code]](../../licensecheck/packageinfo.py#L120)
5636

5737
```python
5838
def getMyPackageLicense() -> str:
@@ -70,7 +50,7 @@ Get the pyproject data.
7050

7151
## getPackages
7252

73-
[[find in source code]](../../licensecheck/packageinfo.py#L152)
53+
[[find in source code]](../../licensecheck/packageinfo.py#L104)
7454

7555
```python
7656
def getPackages(reqs: list[str]) -> list[PackageInfo]:
@@ -88,34 +68,13 @@ Get dependency info.
8868

8969
## getPackagesFromLocal
9070

91-
[[find in source code]](../../licensecheck/packageinfo.py#L23)
71+
[[find in source code]](../../licensecheck/packageinfo.py#L18)
9272

9373
```python
9474
def getPackagesFromLocal(requirements: list[str]) -> list[PackageInfo]:
9575
```
9676

97-
Get a list of package info from local files including version, author...
98-
99-
and the license.
100-
101-
#### Arguments
102-
103-
- `requirements` *list[str]* - [description]
104-
105-
#### Returns
106-
107-
- `list[PackageInfo]` - [description]
108-
109-
## getPackagesFromOnline
110-
111-
[[find in source code]](../../licensecheck/packageinfo.py#L97)
112-
113-
```python
114-
def getPackagesFromOnline(requirements: list[str]) -> list[PackageInfo]:
115-
```
116-
117-
Get a list of package info from pypi.org including version, author...
118-
77+
Get a list of package info from local files including version, author
11978
and the license.
12079

12180
#### Arguments
@@ -126,38 +85,39 @@ and the license.
12685

12786
- `list[PackageInfo]` - [description]
12887

129-
## licenseFromClassifierMessage
88+
## licenseFromClassifierlist
13089

131-
[[find in source code]](../../licensecheck/packageinfo.py#L75)
90+
[[find in source code]](../../licensecheck/packageinfo.py#L86)
13291

13392
```python
134-
def licenseFromClassifierMessage(message: Message) -> str:
93+
def licenseFromClassifierlist(classifiers: list[str]) -> str:
13594
```
13695

137-
Get license string from a Message of project classifiers.
96+
Get license string from a list of project classifiers.
13897

13998
#### Arguments
14099

141-
- `message` *Message* - Message of classifiers
100+
- `classifiers` *list[str]* - list of classifiers
142101

143102
#### Returns
144103

145104
- `str` - the license name
146105

147-
## licenseFromClassifierlist
106+
## packageInfoFromPypi
148107

149-
[[find in source code]](../../licensecheck/packageinfo.py#L130)
108+
[[find in source code]](../../licensecheck/packageinfo.py#L56)
150109

151110
```python
152-
def licenseFromClassifierlist(classifiers: list[str]) -> str:
111+
def packageInfoFromPypi(requirements: list[str]) -> list[PackageInfo]:
153112
```
154113

155-
Get license string from a list of project classifiers.
114+
Get a list of package info from pypi.org including version, author
115+
and the license.
156116

157117
#### Arguments
158118

159-
- `classifiers` *list[str]* - list of classifiers
119+
- `requirements` *list[str]* - [description]
160120

161121
#### Returns
162122

163-
- `str` - the license name
123+
- `list[PackageInfo]` - [description]

0 commit comments

Comments
 (0)