Skip to content

Commit d31f95c

Browse files
committed
rel 2025
1 parent ad41f42 commit d31f95c

File tree

10 files changed

+74
-109
lines changed

10 files changed

+74
-109
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ repos:
6464
- id: optimize-svg
6565
- id: optimize-webp
6666

67-
exclude: "tests/data|documentation/reference"
67+
exclude: "tests/data|tests/platform_independent/data|documentation/reference"

documentation/reference/licensecheck/packageinfo.md

+34-37
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## LocalPackageInfo
2424

25-
[Show source in packageinfo.py:80](../../../licensecheck/packageinfo.py#L80)
25+
[Show source in packageinfo.py:75](../../../licensecheck/packageinfo.py#L75)
2626

2727
Handles retrieval of package info from local installation.
2828

@@ -34,21 +34,18 @@ class LocalPackageInfo: ...
3434

3535
### LocalPackageInfo.get_info
3636

37-
[Show source in packageinfo.py:83](../../../licensecheck/packageinfo.py#L83)
37+
[Show source in packageinfo.py:78](../../../licensecheck/packageinfo.py#L78)
3838

3939
Retrieve package metadata from local installation.
4040

4141
#### Arguments
4242

4343
- `package` *ucstr* - Package name.
4444

45-
#### Raises
46-
47-
- `ModuleNotFoundError` - If the package is not found locally.
48-
4945
#### Returns
5046

51-
- `PackageInfo` - Local package information.
47+
Type: *PackageInfo*
48+
Local package information.
5249

5350
#### Signature
5451

@@ -64,7 +61,7 @@ def get_info(package: ucstr) -> PackageInfo: ...
6461

6562
### LocalPackageInfo.get_size
6663

67-
[Show source in packageinfo.py:116](../../../licensecheck/packageinfo.py#L116)
64+
[Show source in packageinfo.py:104](../../../licensecheck/packageinfo.py#L104)
6865

6966
Retrieve installed package size.
7067

@@ -74,7 +71,8 @@ Retrieve installed package size.
7471

7572
#### Returns
7673

77-
- `int` - Size in bytes.
74+
Type: *int*
75+
Size in bytes.
7876

7977
#### Signature
8078

@@ -104,17 +102,16 @@ class PackageInfoManager:
104102

105103
### PackageInfoManager().getPackages
106104

107-
[Show source in packageinfo.py:29](../../../licensecheck/packageinfo.py#L29)
105+
[Show source in packageinfo.py:34](../../../licensecheck/packageinfo.py#L34)
108106

109107
Retrieve package information from local installation or PyPI.
110108

111-
#### Arguments
112-
113-
- `reqs` *set[ucstr]* - Set of dependency names to retrieve information for.
109+
:param set[ucstr] reqs: Set of dependency names to retrieve information for.
114110

115111
#### Returns
116112

117-
- `set[PackageInfo]` - A set of package information objects.
113+
Type: *set[PackageInfo]*
114+
A set of package information objects.
118115

119116
#### Signature
120117

@@ -129,17 +126,18 @@ def getPackages(self, reqs: set[ucstr]) -> set[PackageInfo]: ...
129126

130127
### PackageInfoManager().get_package_info
131128

132-
[Show source in packageinfo.py:47](../../../licensecheck/packageinfo.py#L47)
129+
[Show source in packageinfo.py:48](../../../licensecheck/packageinfo.py#L48)
133130

134131
Retrieve package information, preferring local data.
135132

136133
#### Arguments
137134

138-
- `package` *ucstr* - Package name.
135+
- `pacage` *ucstr* - Package name.
139136

140137
#### Returns
141138

142-
- `PackageInfo` - Information about the package.
139+
Type: *PackageInfo*
140+
Information about the package.
143141

144142
#### Signature
145143

@@ -156,7 +154,7 @@ def get_package_info(self, package: ucstr) -> PackageInfo: ...
156154

157155
## ProjectMetadata
158156

159-
[Show source in packageinfo.py:222](../../../licensecheck/packageinfo.py#L222)
157+
[Show source in packageinfo.py:192](../../../licensecheck/packageinfo.py#L192)
160158

161159
Handles extraction of project metadata from configuration files.
162160

@@ -168,13 +166,14 @@ class ProjectMetadata: ...
168166

169167
### ProjectMetadata.get_license
170168

171-
[Show source in packageinfo.py:250](../../../licensecheck/packageinfo.py#L250)
169+
[Show source in packageinfo.py:220](../../../licensecheck/packageinfo.py#L220)
172170

173171
Extract license from project metadata.
174172

175173
#### Returns
176174

177-
- `ucstr` - License string.
175+
Type: *ucstr*
176+
License string.
178177

179178
#### Signature
180179

@@ -189,7 +188,7 @@ def get_license() -> ucstr: ...
189188

190189
### ProjectMetadata.get_metadata
191190

192-
[Show source in packageinfo.py:225](../../../licensecheck/packageinfo.py#L225)
191+
[Show source in packageinfo.py:195](../../../licensecheck/packageinfo.py#L195)
193192

194193
Extract project metadata from setup.cfg or pyproject.toml.
195194

@@ -209,7 +208,7 @@ def get_metadata() -> dict[str, Any]: ...
209208

210209
## RemotePackageInfo
211210

212-
[Show source in packageinfo.py:131](../../../licensecheck/packageinfo.py#L131)
211+
[Show source in packageinfo.py:115](../../../licensecheck/packageinfo.py#L115)
213212

214213
Handles retrieval of package info from PyPI.
215214

@@ -221,7 +220,7 @@ class RemotePackageInfo: ...
221220

222221
### RemotePackageInfo.get_info
223222

224-
[Show source in packageinfo.py:134](../../../licensecheck/packageinfo.py#L134)
223+
[Show source in packageinfo.py:118](../../../licensecheck/packageinfo.py#L118)
225224

226225
Retrieve package metadata from PyPI.
227226

@@ -230,13 +229,10 @@ Retrieve package metadata from PyPI.
230229
- `package` *ucstr* - Package name.
231230
- `pypi_api` *str* - PyPI API base URL.
232231

233-
#### Raises
234-
235-
- `ModuleNotFoundError` - If package is not found.
236-
237232
#### Returns
238233

239-
- `PackageInfo` - Remote package information.
234+
Type: *PackageInfo*
235+
Remote package information.
240236

241237
#### Signature
242238

@@ -252,17 +248,16 @@ def get_info(package: ucstr, pypi_api: str) -> PackageInfo: ...
252248

253249
### RemotePackageInfo.get_size
254250

255-
[Show source in packageinfo.py:171](../../../licensecheck/packageinfo.py#L171)
251+
[Show source in packageinfo.py:148](../../../licensecheck/packageinfo.py#L148)
256252

257253
Retrieve package size from PyPI metadata.
258254

259-
#### Arguments
260-
261-
data (dict[str, Any]): PyPI response JSON.
255+
:param dict[str, Any] data: PyPI response JSON.
262256

263257
#### Returns
264258

265-
- `int` - Package size in bytes.
259+
Type: *int*
260+
Package size in bytes.
266261

267262
#### Signature
268263

@@ -275,7 +270,7 @@ def get_size(data: dict[str, Any]) -> int: ...
275270

276271
## from_classifiers
277272

278-
[Show source in packageinfo.py:203](../../../licensecheck/packageinfo.py#L203)
273+
[Show source in packageinfo.py:173](../../../licensecheck/packageinfo.py#L173)
279274

280275
Extract license from classifiers.
281276

@@ -300,18 +295,20 @@ def from_classifiers(classifiers: list[str] | None) -> ucstr: ...
300295

301296
## meta_get
302297

303-
[Show source in packageinfo.py:186](../../../licensecheck/packageinfo.py#L186)
298+
[Show source in packageinfo.py:160](../../../licensecheck/packageinfo.py#L160)
304299

305300
Retrieve metadata value safely.
306301

302+
:param metadata.PackageMetadata | dict[str, Any] metadata_obj: Metadata source.
303+
307304
#### Arguments
308305

309-
metadata_obj (metadata.PackageMetadata | dict[str, Any]): Metadata source.
310306
- `key` *str* - Metadata key.
311307

312308
#### Returns
313309

314-
- `str` - Retrieved metadata value.
310+
Type: *str*
311+
Retrieved metadata value.
315312

316313
#### Signature
317314

documentation/reference/licensecheck/types.md

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

1515
## License
1616

17-
[Show source in types.py:56](../../../licensecheck/types.py#L56)
17+
[Show source in types.py:58](../../../licensecheck/types.py#L58)
1818

1919
#### Attributes
2020

@@ -49,7 +49,7 @@ class License(Enum): ...
4949

5050
## PackageInfo
5151

52-
[Show source in types.py:30](../../../licensecheck/types.py#L30)
52+
[Show source in types.py:32](../../../licensecheck/types.py#L32)
5353

5454
PackageInfo type.
5555

@@ -61,7 +61,7 @@ class PackageInfo: ...
6161

6262
### PackageInfo().__post_init__
6363

64-
[Show source in types.py:43](../../../licensecheck/types.py#L43)
64+
[Show source in types.py:45](../../../licensecheck/types.py#L45)
6565

6666
Set the namever once the object is initialised.
6767

@@ -73,7 +73,7 @@ def __post_init__(self) -> None: ...
7373

7474
### PackageInfo().get_filtered_dict
7575

76-
[Show source in types.py:47](../../../licensecheck/types.py#L47)
76+
[Show source in types.py:49](../../../licensecheck/types.py#L49)
7777

7878
Return a filtered dictionary of the object.
7979

@@ -98,7 +98,7 @@ def get_filtered_dict(self, hide_output_parameters: list[ucstr]) -> dict: ...
9898

9999
## ucstr
100100

101-
[Show source in types.py:9](../../../licensecheck/types.py#L9)
101+
[Show source in types.py:11](../../../licensecheck/types.py#L11)
102102

103103
Uppercase string.
104104

@@ -110,7 +110,7 @@ class ucstr(str): ...
110110

111111
### ucstr().__new__
112112

113-
[Show source in types.py:14](../../../licensecheck/types.py#L14)
113+
[Show source in types.py:16](../../../licensecheck/types.py#L16)
114114

115115
Create a new ucstr from a str.
116116

@@ -126,5 +126,5 @@ uppercase string.
126126
#### Signature
127127

128128
```python
129-
def __new__(cls, v: str | None) -> ucstr: ...
129+
def __new__(cls, v: str | None) -> Self: ...
130130
```

licensecheck/license_matrix/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,4 @@ def liceCompat(
199199
licenses = list(L)
200200
row, col = licenses.index(myLicense) + 1, licenses.index(lice) + 1
201201

202-
if LICENSE_MATRIX[row][col] == "1":
203-
return True
204-
return False
202+
return LICENSE_MATRIX[row][col] == "1"

0 commit comments

Comments
 (0)