Skip to content

Commit dd02bd7

Browse files
committed
rel 2024.1
1 parent f5f5885 commit dd02bd7

17 files changed

+194
-183
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ patch-level version changes can be found in [commit messages](../../commits/mast
99
- fix issue where onlyLicenses logic caused licensecompat to be `false` when unspecified from the command line
1010
- move `cli()` to `cli.py`
1111
- add tests for the main entry point
12+
- update deps
1213

1314
## 2024 - 2024/01/27
1415

documentation/reference/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ A full list of `Licensecheck` project modules.
66

77
- [Licensecheck](licensecheck/index.md#licensecheck)
88
- [Module](licensecheck/module.md#module)
9+
- [Cli](licensecheck/cli.md#cli)
910
- [Formatter](licensecheck/formatter.md#formatter)
1011
- [Get Deps](licensecheck/get_deps.md#get-deps)
1112
- [License Matrix](licensecheck/license_matrix.md#license-matrix)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Cli
2+
3+
[Licensecheck Index](../README.md#licensecheck-index) / [Licensecheck](./index.md#licensecheck) / Cli
4+
5+
> Auto-generated documentation for [licensecheck.cli](../../../licensecheck/cli.py) module.
6+
7+
- [Cli](#cli)
8+
- [cli](#cli)
9+
- [main](#main)
10+
11+
## cli
12+
13+
[Show source in cli.py:20](../../../licensecheck/cli.py#L20)
14+
15+
Cli entry point.
16+
17+
#### Signature
18+
19+
```python
20+
def cli() -> None: ...
21+
```
22+
23+
24+
25+
## main
26+
27+
[Show source in cli.py:89](../../../licensecheck/cli.py#L89)
28+
29+
Test entry point.
30+
31+
#### Signature
32+
33+
```python
34+
def main(args: dict) -> int: ...
35+
```

documentation/reference/licensecheck/formatter.md

+36-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## ansi
1616

17-
[Show source in formatter.py:59](../../../licensecheck/formatter.py#L59)
17+
[Show source in formatter.py:61](../../../licensecheck/formatter.py#L61)
1818

1919
Format to ansi.
2020

@@ -23,6 +23,7 @@ Format to ansi.
2323
----
2424
- `myLice` *License* - project license
2525
- `packages` *list[PackageInfo]* - list of PackageCompats to format.
26+
- `hide_parameters` *list[str]* - list of parameters to ignore in the output.
2627

2728
#### Returns
2829

@@ -32,7 +33,11 @@ Format to ansi.
3233
#### Signature
3334

3435
```python
35-
def ansi(myLice: License, packages: list[PackageInfo]) -> str: ...
36+
def ansi(
37+
myLice: License,
38+
packages: list[PackageInfo],
39+
hide_parameters: list[ucstr] | None = None,
40+
) -> str: ...
3641
```
3742

3843
#### See also
@@ -44,7 +49,7 @@ def ansi(myLice: License, packages: list[PackageInfo]) -> str: ...
4449

4550
## markdown
4651

47-
[Show source in formatter.py:123](../../../licensecheck/formatter.py#L123)
52+
[Show source in formatter.py:151](../../../licensecheck/formatter.py#L151)
4853

4954
Format to markdown.
5055

@@ -53,6 +58,7 @@ Format to markdown.
5358
----
5459
- `myLice` *License* - project license
5560
- `packages` *list[PackageInfo]* - list of PackageCompats to format.
61+
- `hide_parameters` *list[str]* - list of parameters to ignore in the output.
5662

5763
#### Returns
5864

@@ -62,7 +68,11 @@ Format to markdown.
6268
#### Signature
6369

6470
```python
65-
def markdown(myLice: License, packages: list[PackageInfo]) -> str: ...
71+
def markdown(
72+
myLice: License,
73+
packages: list[PackageInfo],
74+
hide_parameters: list[ucstr] | None = None,
75+
) -> str: ...
6676
```
6777

6878
#### See also
@@ -74,7 +84,7 @@ def markdown(myLice: License, packages: list[PackageInfo]) -> str: ...
7484

7585
## plainText
7686

77-
[Show source in formatter.py:107](../../../licensecheck/formatter.py#L107)
87+
[Show source in formatter.py:128](../../../licensecheck/formatter.py#L128)
7888

7989
Format to ansi.
8090

@@ -83,6 +93,7 @@ Format to ansi.
8393
----
8494
- `myLice` *License* - project license
8595
- `packages` *list[PackageInfo]* - list of PackageCompats to format.
96+
- `hide_parameters` *list[str]* - list of parameters to ignore in the output.
8697

8798
#### Returns
8899

@@ -92,7 +103,11 @@ Format to ansi.
92103
#### Signature
93104

94105
```python
95-
def plainText(myLice: License, packages: list[PackageInfo]) -> str: ...
106+
def plainText(
107+
myLice: License,
108+
packages: list[PackageInfo],
109+
hide_parameters: list[ucstr] | None = None,
110+
) -> str: ...
96111
```
97112

98113
#### See also
@@ -104,7 +119,7 @@ def plainText(myLice: License, packages: list[PackageInfo]) -> str: ...
104119

105120
## raw
106121

107-
[Show source in formatter.py:165](../../../licensecheck/formatter.py#L165)
122+
[Show source in formatter.py:206](../../../licensecheck/formatter.py#L206)
108123

109124
Format to json.
110125

@@ -113,6 +128,7 @@ Format to json.
113128
----
114129
- `myLice` *License* - project license
115130
- `packages` *list[PackageInfo]* - list of PackageCompats to format.
131+
- `hide_parameters` *list[str]* - list of parameters to ignore in the output.
116132

117133
#### Returns
118134

@@ -122,7 +138,11 @@ Format to json.
122138
#### Signature
123139

124140
```python
125-
def raw(myLice: License, packages: list[PackageInfo]) -> str: ...
141+
def raw(
142+
myLice: License,
143+
packages: list[PackageInfo],
144+
hide_parameters: list[ucstr] | None = None,
145+
) -> str: ...
126146
```
127147

128148
#### See also
@@ -134,7 +154,7 @@ def raw(myLice: License, packages: list[PackageInfo]) -> str: ...
134154

135155
## rawCsv
136156

137-
[Show source in formatter.py:188](../../../licensecheck/formatter.py#L188)
157+
[Show source in formatter.py:236](../../../licensecheck/formatter.py#L236)
138158

139159
Format to csv.
140160

@@ -143,6 +163,7 @@ Format to csv.
143163
----
144164
- `myLice` *License* - project license
145165
- `packages` *list[PackageInfo]* - list of PackageCompats to format.
166+
- `hide_parameters` *list[str]* - list of parameters to ignore in the output.
146167

147168
#### Returns
148169

@@ -152,7 +173,11 @@ Format to csv.
152173
#### Signature
153174

154175
```python
155-
def rawCsv(myLice: License, packages: list[PackageInfo]) -> str: ...
176+
def rawCsv(
177+
myLice: License,
178+
packages: list[PackageInfo],
179+
hide_parameters: list[ucstr] | None = None,
180+
) -> str: ...
156181
```
157182

158183
#### See also
@@ -164,7 +189,7 @@ def rawCsv(myLice: License, packages: list[PackageInfo]) -> str: ...
164189

165190
## stripAnsi
166191

167-
[Show source in formatter.py:44](../../../licensecheck/formatter.py#L44)
192+
[Show source in formatter.py:46](../../../licensecheck/formatter.py#L46)
168193

169194
Strip ansi codes from a given string.
170195

documentation/reference/licensecheck/get_deps.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,31 @@
1111

1212
## do_get_reqs
1313

14-
[Show source in get_deps.py:61](../../../licensecheck/get_deps.py#L61)
14+
[Show source in get_deps.py:64](../../../licensecheck/get_deps.py#L64)
15+
16+
Underlying machineary to get requirements.
17+
18+
#### Arguments
19+
20+
----
21+
- `using` *str* - use requirements, poetry or PEP631.
22+
- `skipDependencies` *list[str]* - list of dependencies to skip.
23+
extras (str | None): to-do
24+
pyproject (dict[str, Any]): to-do
25+
- `requirementsPaths` *list[Path]* - to-do
26+
27+
#### Returns
28+
29+
-------
30+
- `set[str]` - set of requirement packages
1531

1632
#### Signature
1733

1834
```python
1935
def do_get_reqs(
2036
using: str,
2137
skipDependencies: list[ucstr],
22-
extras: str | None,
38+
extras: list[str],
2339
pyproject: dict[str, Any],
2440
requirementsPaths: list[Path],
2541
) -> set[ucstr]: ...
@@ -33,7 +49,7 @@ def do_get_reqs(
3349

3450
## getDepsWithLicenses
3551

36-
[Show source in get_deps.py:173](../../../licensecheck/get_deps.py#L173)
52+
[Show source in get_deps.py:188](../../../licensecheck/get_deps.py#L188)
3753

3854
Get a set of dependencies with licenses and determine license compatibility.
3955

@@ -46,6 +62,7 @@ Get a set of dependencies with licenses and determine license compatibility.
4662
- `ignoreLicenses` *list[ucstr]* - a list of licenses to ignore (skipped, compat may still be
4763
False)
4864
- `failLicenses` *list[ucstr]* - a list of licenses to fail (compat=False)
65+
- `onlyLicenses` *list[ucstr]* - a list of allowed licenses (any other license will fail)
4966
- `skipDependencies` *list[ucstr]* - a list of dependencies to skip (compat=False)
5067

5168
#### Returns
@@ -64,6 +81,7 @@ def getDepsWithLicenses(
6481
failPackages: list[ucstr],
6582
ignoreLicenses: list[ucstr],
6683
failLicenses: list[ucstr],
84+
onlyLicenses: list[ucstr],
6785
skipDependencies: list[ucstr],
6886
) -> tuple[License, set[PackageInfo]]: ...
6987
```

documentation/reference/licensecheck/index.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,12 @@
55
> Auto-generated documentation for [licensecheck](../../../licensecheck/__init__.py) module.
66
77
- [Licensecheck](#licensecheck)
8-
- [cli](#cli)
98
- [Modules](#modules)
109

11-
## cli
12-
13-
[Show source in __init__.py:18](../../../licensecheck/__init__.py#L18)
14-
15-
Cli entry point.
16-
17-
#### Signature
18-
19-
```python
20-
def cli() -> None: ...
21-
```
22-
23-
24-
2510
## Modules
2611

2712
- [Module](./module.md)
13+
- [Cli](./cli.md)
2814
- [Formatter](./formatter.md)
2915
- [Get Deps](./get_deps.md)
3016
- [License Matrix](./license_matrix.md)

documentation/reference/licensecheck/license_matrix.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## depCompatWMyLice
1414

15-
[Show source in license_matrix.py:135](../../../licensecheck/license_matrix.py#L135)
15+
[Show source in license_matrix.py:136](../../../licensecheck/license_matrix.py#L136)
1616

1717
Identify if the end user license is compatible with the dependency license(s).
1818

@@ -23,6 +23,7 @@ Identify if the end user license is compatible with the dependency license(s).
2323
- `depLice` *list[L]* - dependency license
2424
- `ignoreLicenses` *list[L], optional* - list of licenses to ignore. Defaults to None.
2525
- `failLicenses` *list[L], optional* - list of licenses to fail on. Defaults to None.
26+
- `onlyLicenses` *list[L], optional* - list of allowed licenses. Defaults to None.
2627

2728
#### Returns
2829

@@ -37,6 +38,7 @@ def depCompatWMyLice(
3738
depLice: list[L],
3839
ignoreLicenses: list[L] | None = None,
3940
failLicenses: list[L] | None = None,
41+
onlyLicenses: list[L] | None = None,
4042
) -> bool: ...
4143
```
4244

@@ -48,7 +50,7 @@ def depCompatWMyLice(
4850

4951
## liceCompat
5052

51-
[Show source in license_matrix.py:171](../../../licensecheck/license_matrix.py#L171)
53+
[Show source in license_matrix.py:176](../../../licensecheck/license_matrix.py#L176)
5254

5355
Identify if the end user license is compatible with the dependency license.
5456

@@ -58,6 +60,7 @@ Identify if the end user license is compatible with the dependency license.
5860
- `lice` *L* - dependency license
5961
:param list[L] ignoreLicenses: list of licenses to ignore. Defaults to None.
6062
:param list[L] failLicenses: list of licenses to fail on. Defaults to None.
63+
:param list[L] onlyLicenses: list of allowed licenses. Defaults to None.
6164

6265
#### Returns
6366

@@ -68,7 +71,11 @@ True if compatible, otherwise False
6871

6972
```python
7073
def liceCompat(
71-
myLicense: L, lice: L, ignoreLicenses: list[L], failLicenses: list[L]
74+
myLicense: L,
75+
lice: L,
76+
ignoreLicenses: list[L],
77+
failLicenses: list[L],
78+
onlyLicenses: list[L],
7279
) -> bool: ...
7380
```
7481

@@ -80,7 +87,7 @@ def liceCompat(
8087

8188
## licenseLookup
8289

83-
[Show source in license_matrix.py:54](../../../licensecheck/license_matrix.py#L54)
90+
[Show source in license_matrix.py:55](../../../licensecheck/license_matrix.py#L55)
8491

8592
Identify a license from an uppercase string representation of a license.
8693

@@ -110,7 +117,7 @@ def licenseLookup(licenseStr: ucstr, ignoreLicenses: list[ucstr] | None = None)
110117

111118
## licenseType
112119

113-
[Show source in license_matrix.py:116](../../../licensecheck/license_matrix.py#L116)
120+
[Show source in license_matrix.py:117](../../../licensecheck/license_matrix.py#L117)
114121

115122
Return a list of license types from a license string.
116123

0 commit comments

Comments
 (0)