Skip to content

Commit 5386ec4

Browse files
committed
rel 2024
1 parent d7c789e commit 5386ec4

File tree

7 files changed

+42
-21
lines changed

7 files changed

+42
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
All major and minor version changes will be documented in this file. Details of
44
patch-level version changes can be found in [commit messages](../../commits/master).
55

6-
## 2022 - 2022/04/09
6+
## 2024 - 2024/03/17
77

88
- Removed ujson optional dependency per https://pythonspeed.com/articles/faster-json-library/:
99
tldr it probably won't be significantly faster and may be error prone

documentation/reference/licensematrix/license_matrix.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Make a list of Licenses from a json file.
2424

2525
```python
2626
class LicenseMatrix:
27-
def __init__(self): ...
27+
def __init__(self) -> None: ...
2828
```
2929

3030
### LicenseMatrix().buildLicenses
@@ -87,6 +87,10 @@ def buildLicenses(
8787
) -> list[License]: ...
8888
```
8989

90+
#### See also
91+
92+
- [License](./license_type.md#license)
93+
9094
### LicenseMatrix().closestSPDX
9195

9296
[Show source in license_matrix.py:150](../../../licensematrix/license_matrix.py#L150)
@@ -109,6 +113,10 @@ Guarantee a license from a spdx id (may be inaccurate).
109113
def closestSPDX(self, spdx: str) -> License: ...
110114
```
111115

116+
#### See also
117+
118+
- [License](./license_type.md#license)
119+
112120
### LicenseMatrix().closestTitle
113121

114122
[Show source in license_matrix.py:167](../../../licensematrix/license_matrix.py#L167)
@@ -131,6 +139,10 @@ Guarantee a license from a name (may be inaccurate).
131139
def closestTitle(self, name: str) -> License: ...
132140
```
133141

142+
#### See also
143+
144+
- [License](./license_type.md#license)
145+
134146
### LicenseMatrix().licenseFromAltName
135147

136148
[Show source in license_matrix.py:109](../../../licensematrix/license_matrix.py#L109)
@@ -217,4 +229,8 @@ Get a list of candidate licenses from a search string.
217229

218230
```python
219231
def searchLicenses(self, search: str) -> list[License]: ...
220-
```
232+
```
233+
234+
#### See also
235+
236+
- [License](./license_type.md#license)

documentation/reference/licensematrix/license_type.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class License:
4848
typeIn: str = "",
4949
spdx: str = "",
5050
fromDict: dict[str, Any] | None = None,
51-
): ...
51+
) -> None: ...
5252
```
5353

5454
### License().__repr__
@@ -79,7 +79,7 @@ def __str__(self) -> str: ...
7979

8080
[Show source in license_type.py:89](../../../licensematrix/license_type.py#L89)
8181

82-
Is the License Copyleft?
82+
Is the License Copyleft?.
8383

8484
#### Signature
8585

@@ -91,7 +91,7 @@ def isCopyleft(self): ...
9191

9292
[Show source in license_type.py:81](../../../licensematrix/license_type.py#L81)
9393

94-
Is the License Permissive?
94+
Is the License Permissive?.
9595

9696
#### Signature
9797

@@ -103,7 +103,7 @@ def isPermissive(self): ...
103103

104104
[Show source in license_type.py:97](../../../licensematrix/license_type.py#L97)
105105

106-
Is the License Public Domain?
106+
Is the License Public Domain?.
107107

108108
#### Signature
109109

@@ -115,7 +115,7 @@ def isPublicDomain(self): ...
115115

116116
[Show source in license_type.py:93](../../../licensematrix/license_type.py#L93)
117117

118-
Is the License Viral?
118+
Is the License Viral?.
119119

120120
#### Signature
121121

@@ -127,7 +127,7 @@ def isViral(self): ...
127127

128128
[Show source in license_type.py:85](../../../licensematrix/license_type.py#L85)
129129

130-
Is the License Weak Copyleft?
130+
Is the License Weak Copyleft?.
131131

132132
#### Signature
133133

@@ -303,7 +303,7 @@ def termsCompatible(self, dest: License) -> bool: ...
303303

304304
[Show source in license_type.py:310](../../../licensematrix/license_type.py#L310)
305305

306-
Are two licenses equal?
306+
Are two licenses equal?.
307307

308308
#### Arguments
309309

licensematrix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
from __future__ import annotations
44

5-
from .license_matrix import LicenseMatrix
5+
from licensematrix.license_matrix import LicenseMatrix
66

77
licenseMatrix = LicenseMatrix()

licensematrix/license_matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from operator import itemgetter
88
from pathlib import Path
99

10-
from .license_type import License
10+
from licensematrix.license_type import License
1111

1212
THISDIR = Path(__file__).resolve().parent
1313

@@ -17,7 +17,7 @@ class LicenseMatrix:
1717

1818
__slots__ = ["licenses"]
1919

20-
def __init__(self):
20+
def __init__(self) -> None:
2121
"""Make a list of Licenses from a json file."""
2222
self.licenses = self.buildLicenses()
2323

licensematrix/license_type.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
typeIn: str = "",
2828
spdx: str = "",
2929
fromDict: dict[str, Any] | None = None,
30-
):
30+
) -> None:
3131
"""Construct License. Create from a dict of 'by hand'.
3232
3333
Args:
@@ -79,23 +79,23 @@ def __str__(self) -> str:
7979
return f"<{self.name} type:{self.type} spdx:{self.spdx}>"
8080

8181
def isPermissive(self):
82-
"""Is the License Permissive?"""
82+
"""Is the License Permissive?."""
8383
return self.type == "Permissive"
8484

8585
def isWeakCopyleft(self):
86-
"""Is the License Weak Copyleft?"""
86+
"""Is the License Weak Copyleft?."""
8787
return self.type == "Weak Copyleft"
8888

8989
def isCopyleft(self):
90-
"""Is the License Copyleft?"""
90+
"""Is the License Copyleft?."""
9191
return self.type == "Copyleft"
9292

9393
def isViral(self):
94-
"""Is the License Viral?"""
94+
"""Is the License Viral?."""
9595
return self.type == "Viral"
9696

9797
def isPublicDomain(self):
98-
"""Is the License Public Domain?"""
98+
"""Is the License Public Domain?."""
9999
return self.type == "Public Domain"
100100

101101
def mergeBoth(self, rhs: License):
@@ -308,7 +308,7 @@ def mergeSPDX(spdxA: str, spdxB: str) -> str:
308308

309309

310310
def equal(licenseA: License, licenseB: License) -> bool:
311-
"""Are two licenses equal?
311+
"""Are two licenses equal?.
312312
313313
Args:
314314
----

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "licensematrix"
3-
version = "2022"
3+
version = "2024"
44
license = "mit"
55
description = "List of popular open source licenses with naive functions to determine compatibility and search for a license from a string"
66
authors = ["FredHappyface"]
@@ -29,6 +29,11 @@ python = "^3.8"
2929
[tool.poetry.group.dev.dependencies]
3030
requests = "^2.31.0"
3131
requests-cache = "^1.2.0"
32+
pytest = "^8.1.1"
33+
handsdown = "^2.1.0"
34+
coverage = "^7.4.4"
35+
ruff = "^0.2.2"
36+
pyright = "^1.1.354"
3237

3338
[build-system]
3439
requires = ["poetry-core"]

0 commit comments

Comments
 (0)