python-alpm 0.2.0__cp310-abi3-manylinux_2_31_riscv64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of python-alpm might be problematic. Click here for more details.
- alpm/__init__.py +6 -0
- alpm/__pycache__/__init__.cpython-313.pyc +0 -0
- alpm/__pycache__/alpm_types.cpython-313.pyc +0 -0
- alpm/__pycache__/type_aliases.cpython-313.pyc +0 -0
- alpm/_native.abi3.so +0 -0
- alpm/_native.pyi +4 -0
- alpm/alpm_srcinfo/__init__.pyi +20 -0
- alpm/alpm_srcinfo/__pycache__/__init__.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/__pycache__/error.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/__pycache__/schema.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/error.pyi +8 -0
- alpm/alpm_srcinfo/schema.pyi +70 -0
- alpm/alpm_srcinfo/source_info/__init__.pyi +54 -0
- alpm/alpm_srcinfo/source_info/__pycache__/__init__.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/source_info/v1/__init__.pyi +102 -0
- alpm/alpm_srcinfo/source_info/v1/__pycache__/__init__.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/source_info/v1/__pycache__/merged.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/source_info/v1/__pycache__/package.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/source_info/v1/__pycache__/package_base.cpython-313.pyc +0 -0
- alpm/alpm_srcinfo/source_info/v1/merged.pyi +188 -0
- alpm/alpm_srcinfo/source_info/v1/package.pyi +257 -0
- alpm/alpm_srcinfo/source_info/v1/package_base.pyi +386 -0
- alpm/alpm_types.pyi +1357 -0
- alpm/py.typed +0 -0
- alpm/type_aliases.py +135 -0
- python_alpm-0.2.0.dist-info/METADATA +9 -0
- python_alpm-0.2.0.dist-info/RECORD +28 -0
- python_alpm-0.2.0.dist-info/WHEEL +4 -0
alpm/alpm_types.pyi
ADDED
|
@@ -0,0 +1,1357 @@
|
|
|
1
|
+
"""Python bindings for alpm-types Rust crate."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from typing import Union, Optional, Sequence
|
|
7
|
+
|
|
8
|
+
from .type_aliases import (
|
|
9
|
+
OpenPGPIdentifier,
|
|
10
|
+
MakepkgOption,
|
|
11
|
+
RelationOrSoname,
|
|
12
|
+
VersionOrSoname,
|
|
13
|
+
VcsInfo,
|
|
14
|
+
SystemArchitecture,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
class ALPMError(Exception):
|
|
18
|
+
"""The ALPM error type."""
|
|
19
|
+
|
|
20
|
+
class Blake2b512Checksum:
|
|
21
|
+
"""A checksum using the Blake2b512 algorithm."""
|
|
22
|
+
|
|
23
|
+
def __init__(self, value: str): ...
|
|
24
|
+
def __str__(self) -> str: ...
|
|
25
|
+
def __repr__(self) -> str: ...
|
|
26
|
+
def __eq__(self, other: object) -> bool: ...
|
|
27
|
+
def __lt__(self, other: "Blake2b512Checksum") -> bool: ...
|
|
28
|
+
def __le__(self, other: "Blake2b512Checksum") -> bool: ...
|
|
29
|
+
def __gt__(self, other: "Blake2b512Checksum") -> bool: ...
|
|
30
|
+
def __ge__(self, other: "Blake2b512Checksum") -> bool: ...
|
|
31
|
+
|
|
32
|
+
class Md5Checksum:
|
|
33
|
+
"""A checksum using the Md5 algorithm.
|
|
34
|
+
|
|
35
|
+
WARNING: Use of this algorithm is highly discouraged, because it is
|
|
36
|
+
cryptographically unsafe.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, value: str): ...
|
|
40
|
+
def __str__(self) -> str: ...
|
|
41
|
+
def __repr__(self) -> str: ...
|
|
42
|
+
def __eq__(self, other: object) -> bool: ...
|
|
43
|
+
def __lt__(self, other: "Md5Checksum") -> bool: ...
|
|
44
|
+
def __le__(self, other: "Md5Checksum") -> bool: ...
|
|
45
|
+
def __gt__(self, other: "Md5Checksum") -> bool: ...
|
|
46
|
+
def __ge__(self, other: "Md5Checksum") -> bool: ...
|
|
47
|
+
|
|
48
|
+
class Sha1Checksum:
|
|
49
|
+
"""A checksum using the Sha1 algorithm.
|
|
50
|
+
|
|
51
|
+
WARNING: Use of this algorithm is highly discouraged, because it is
|
|
52
|
+
cryptographically unsafe.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(self, value: str): ...
|
|
56
|
+
def __str__(self) -> str: ...
|
|
57
|
+
def __repr__(self) -> str: ...
|
|
58
|
+
def __eq__(self, other: object) -> bool: ...
|
|
59
|
+
def __lt__(self, other: "Sha1Checksum") -> bool: ...
|
|
60
|
+
def __le__(self, other: "Sha1Checksum") -> bool: ...
|
|
61
|
+
def __gt__(self, other: "Sha1Checksum") -> bool: ...
|
|
62
|
+
def __ge__(self, other: "Sha1Checksum") -> bool: ...
|
|
63
|
+
|
|
64
|
+
class Sha224Checksum:
|
|
65
|
+
"""A checksum using the Sha224 algorithm."""
|
|
66
|
+
|
|
67
|
+
def __init__(self, value: str): ...
|
|
68
|
+
def __str__(self) -> str: ...
|
|
69
|
+
def __repr__(self) -> str: ...
|
|
70
|
+
def __eq__(self, other: object) -> bool: ...
|
|
71
|
+
def __lt__(self, other: "Sha224Checksum") -> bool: ...
|
|
72
|
+
def __le__(self, other: "Sha224Checksum") -> bool: ...
|
|
73
|
+
def __gt__(self, other: "Sha224Checksum") -> bool: ...
|
|
74
|
+
def __ge__(self, other: "Sha224Checksum") -> bool: ...
|
|
75
|
+
|
|
76
|
+
class Sha256Checksum:
|
|
77
|
+
"""A checksum using the Sha256 algorithm."""
|
|
78
|
+
|
|
79
|
+
def __init__(self, value: str): ...
|
|
80
|
+
def __str__(self) -> str: ...
|
|
81
|
+
def __repr__(self) -> str: ...
|
|
82
|
+
def __eq__(self, other: object) -> bool: ...
|
|
83
|
+
def __lt__(self, other: "Sha256Checksum") -> bool: ...
|
|
84
|
+
def __le__(self, other: "Sha256Checksum") -> bool: ...
|
|
85
|
+
def __gt__(self, other: "Sha256Checksum") -> bool: ...
|
|
86
|
+
def __ge__(self, other: "Sha256Checksum") -> bool: ...
|
|
87
|
+
|
|
88
|
+
class Sha384Checksum:
|
|
89
|
+
"""A checksum using the Sha384 algorithm."""
|
|
90
|
+
|
|
91
|
+
def __init__(self, value: str): ...
|
|
92
|
+
def __str__(self) -> str: ...
|
|
93
|
+
def __repr__(self) -> str: ...
|
|
94
|
+
def __eq__(self, other: object) -> bool: ...
|
|
95
|
+
def __lt__(self, other: "Sha384Checksum") -> bool: ...
|
|
96
|
+
def __le__(self, other: "Sha384Checksum") -> bool: ...
|
|
97
|
+
def __gt__(self, other: "Sha384Checksum") -> bool: ...
|
|
98
|
+
def __ge__(self, other: "Sha384Checksum") -> bool: ...
|
|
99
|
+
|
|
100
|
+
class Sha512Checksum:
|
|
101
|
+
"""A checksum using the Sha512 algorithm."""
|
|
102
|
+
|
|
103
|
+
def __init__(self, value: str): ...
|
|
104
|
+
def __str__(self) -> str: ...
|
|
105
|
+
def __repr__(self) -> str: ...
|
|
106
|
+
def __eq__(self, other: object) -> bool: ...
|
|
107
|
+
def __lt__(self, other: "Sha512Checksum") -> bool: ...
|
|
108
|
+
def __le__(self, other: "Sha512Checksum") -> bool: ...
|
|
109
|
+
def __gt__(self, other: "Sha512Checksum") -> bool: ...
|
|
110
|
+
def __ge__(self, other: "Sha512Checksum") -> bool: ...
|
|
111
|
+
|
|
112
|
+
class SkippableBlake2b512Checksum:
|
|
113
|
+
"""A checksum using the Blake2b512 algorithm."""
|
|
114
|
+
|
|
115
|
+
def __init__(self, value: str): ...
|
|
116
|
+
@property
|
|
117
|
+
def is_skipped(self) -> bool:
|
|
118
|
+
"""True if the checksum is skipped."""
|
|
119
|
+
|
|
120
|
+
def __str__(self) -> str: ...
|
|
121
|
+
def __repr__(self) -> str: ...
|
|
122
|
+
|
|
123
|
+
class SkippableMd5Checksum:
|
|
124
|
+
"""A checksum using the Md5 algorithm.
|
|
125
|
+
|
|
126
|
+
WARNING: Use of this algorithm is highly discouraged, because it is
|
|
127
|
+
cryptographically unsafe.
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
def __init__(self, value: str): ...
|
|
131
|
+
@property
|
|
132
|
+
def is_skipped(self) -> bool:
|
|
133
|
+
"""True if the checksum is skipped."""
|
|
134
|
+
|
|
135
|
+
def __str__(self) -> str: ...
|
|
136
|
+
def __repr__(self) -> str: ...
|
|
137
|
+
|
|
138
|
+
class SkippableSha1Checksum:
|
|
139
|
+
"""A checksum using the Sha1 algorithm.
|
|
140
|
+
|
|
141
|
+
WARNING: Use of this algorithm is highly discouraged, because it is
|
|
142
|
+
cryptographically unsafe.
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
def __init__(self, value: str): ...
|
|
146
|
+
@property
|
|
147
|
+
def is_skipped(self) -> bool:
|
|
148
|
+
"""True if the checksum is skipped."""
|
|
149
|
+
|
|
150
|
+
def __str__(self) -> str: ...
|
|
151
|
+
def __repr__(self) -> str: ...
|
|
152
|
+
|
|
153
|
+
class SkippableSha224Checksum:
|
|
154
|
+
"""A checksum using the Sha224 algorithm."""
|
|
155
|
+
|
|
156
|
+
def __init__(self, value: str): ...
|
|
157
|
+
@property
|
|
158
|
+
def is_skipped(self) -> bool:
|
|
159
|
+
"""True if the checksum is skipped."""
|
|
160
|
+
|
|
161
|
+
def __str__(self) -> str: ...
|
|
162
|
+
def __repr__(self) -> str: ...
|
|
163
|
+
|
|
164
|
+
class SkippableSha256Checksum:
|
|
165
|
+
"""A checksum using the Sha256 algorithm."""
|
|
166
|
+
|
|
167
|
+
def __init__(self, value: str): ...
|
|
168
|
+
@property
|
|
169
|
+
def is_skipped(self) -> bool:
|
|
170
|
+
"""True if the checksum is skipped."""
|
|
171
|
+
|
|
172
|
+
def __str__(self) -> str: ...
|
|
173
|
+
def __repr__(self) -> str: ...
|
|
174
|
+
|
|
175
|
+
class SkippableSha384Checksum:
|
|
176
|
+
"""A checksum using the Sha384 algorithm."""
|
|
177
|
+
|
|
178
|
+
def __init__(self, value: str): ...
|
|
179
|
+
@property
|
|
180
|
+
def is_skipped(self) -> bool:
|
|
181
|
+
"""True if the checksum is skipped."""
|
|
182
|
+
|
|
183
|
+
def __str__(self) -> str: ...
|
|
184
|
+
def __repr__(self) -> str: ...
|
|
185
|
+
|
|
186
|
+
class SkippableSha512Checksum:
|
|
187
|
+
"""A checksum using the Sha512 algorithm."""
|
|
188
|
+
|
|
189
|
+
def __init__(self, value: str): ...
|
|
190
|
+
@property
|
|
191
|
+
def is_skipped(self) -> bool:
|
|
192
|
+
"""True if the checksum is skipped."""
|
|
193
|
+
|
|
194
|
+
def __str__(self) -> str: ...
|
|
195
|
+
def __repr__(self) -> str: ...
|
|
196
|
+
|
|
197
|
+
class BuildEnvironmentOption:
|
|
198
|
+
"""An option string used in a build environment.
|
|
199
|
+
|
|
200
|
+
The option string is identified by its name and whether it is on (not prefixed with
|
|
201
|
+
"!") or off (prefixed with "!").
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
def __init__(self, option: str) -> None:
|
|
205
|
+
"""Create a new BuildEnvironmentOption.
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
option (str): The option string to parse.
|
|
209
|
+
|
|
210
|
+
Raises:
|
|
211
|
+
ALPMError: If the input doesn't match any known option.
|
|
212
|
+
|
|
213
|
+
"""
|
|
214
|
+
|
|
215
|
+
@property
|
|
216
|
+
def name(self) -> str:
|
|
217
|
+
"""Name of the option."""
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
def on(self) -> bool:
|
|
221
|
+
"""True if the option is on."""
|
|
222
|
+
|
|
223
|
+
def __str__(self) -> str: ...
|
|
224
|
+
def __repr__(self) -> str: ...
|
|
225
|
+
def __eq__(self, other: object) -> bool: ...
|
|
226
|
+
|
|
227
|
+
class PackageOption:
|
|
228
|
+
"""An option string used in packaging.
|
|
229
|
+
|
|
230
|
+
The option string is identified by its name and whether it is on (not prefixed with
|
|
231
|
+
"!") or off (prefixed with "!").
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
def __init__(self, option: str) -> None:
|
|
235
|
+
"""Create a new PackageOption.
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
option (str): The option string to parse.
|
|
239
|
+
|
|
240
|
+
Raises:
|
|
241
|
+
ALPMError: If the input doesn't match any known option.
|
|
242
|
+
|
|
243
|
+
"""
|
|
244
|
+
|
|
245
|
+
@property
|
|
246
|
+
def name(self) -> str:
|
|
247
|
+
"""Name of the option."""
|
|
248
|
+
|
|
249
|
+
@property
|
|
250
|
+
def on(self) -> bool:
|
|
251
|
+
"""True if the option is on."""
|
|
252
|
+
|
|
253
|
+
def __str__(self) -> str: ...
|
|
254
|
+
def __repr__(self) -> str: ...
|
|
255
|
+
def __eq__(self, other: object) -> bool: ...
|
|
256
|
+
|
|
257
|
+
def makepkg_option_from_str(
|
|
258
|
+
option: str,
|
|
259
|
+
) -> MakepkgOption:
|
|
260
|
+
"""Parse a makepkg option string into the appropriate option type.
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
option (str): The option string to parse.
|
|
264
|
+
|
|
265
|
+
Returns:
|
|
266
|
+
MakepkgOption: A valid option object.
|
|
267
|
+
|
|
268
|
+
Raises:
|
|
269
|
+
ALPMError: If the input doesn't match any known option.
|
|
270
|
+
|
|
271
|
+
"""
|
|
272
|
+
...
|
|
273
|
+
|
|
274
|
+
class License:
|
|
275
|
+
"""A license expression.
|
|
276
|
+
|
|
277
|
+
Can be either a valid SPDX identifier or a non-standard one.
|
|
278
|
+
"""
|
|
279
|
+
|
|
280
|
+
def __init__(self, identifier: str) -> None:
|
|
281
|
+
"""Create a new License from an SPDX identifier.
|
|
282
|
+
|
|
283
|
+
Args:
|
|
284
|
+
identifier (str): License expression.
|
|
285
|
+
|
|
286
|
+
"""
|
|
287
|
+
|
|
288
|
+
@staticmethod
|
|
289
|
+
def from_valid_spdx(identifier: str) -> "License":
|
|
290
|
+
"""Create a new License instance from a valid SPDX identifier string.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
identifier (str): A valid SPDX license identifier.
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
license (License): A new License instance.
|
|
297
|
+
|
|
298
|
+
Raises:
|
|
299
|
+
ALPMError: If the identifier is not a valid SPDX license identifier.
|
|
300
|
+
|
|
301
|
+
"""
|
|
302
|
+
|
|
303
|
+
@property
|
|
304
|
+
def is_spdx(self) -> bool:
|
|
305
|
+
"""True if the license is a valid SPDX identifier."""
|
|
306
|
+
|
|
307
|
+
def __str__(self) -> str: ...
|
|
308
|
+
def __repr__(self) -> str: ...
|
|
309
|
+
def __eq__(self, other: object) -> bool: ...
|
|
310
|
+
|
|
311
|
+
class OpenPGPKeyId:
|
|
312
|
+
"""An OpenPGP Key ID.
|
|
313
|
+
|
|
314
|
+
Wraps a string representing a valid OpenPGP Key ID, ensuring that it consists of
|
|
315
|
+
exactly 16 uppercase hexadecimal characters.
|
|
316
|
+
"""
|
|
317
|
+
|
|
318
|
+
def __init__(self, key_id: str) -> None:
|
|
319
|
+
"""Create a new OpenPGP key ID from a string representation.
|
|
320
|
+
|
|
321
|
+
Args:
|
|
322
|
+
key_id (str): A string representing the OpenPGP Key ID,
|
|
323
|
+
which must be exactly 16 uppercase hexadecimal characters.
|
|
324
|
+
|
|
325
|
+
Returns:
|
|
326
|
+
OpenPGPKeyId: A new instance of OpenPGPKeyId.
|
|
327
|
+
|
|
328
|
+
Raises:
|
|
329
|
+
ALPMError: If the input string is not a valid OpenPGP Key ID.
|
|
330
|
+
|
|
331
|
+
"""
|
|
332
|
+
|
|
333
|
+
def __str__(self) -> str: ...
|
|
334
|
+
def __repr__(self) -> str: ...
|
|
335
|
+
def __eq__(self, other: object) -> bool: ...
|
|
336
|
+
|
|
337
|
+
class OpenPGPv4Fingerprint:
|
|
338
|
+
"""An OpenPGP v4 fingerprint.
|
|
339
|
+
|
|
340
|
+
Wraps a string representing a valid OpenPGP v4 fingerprint, ensuring that it
|
|
341
|
+
consists of exactly 40 uppercase hexadecimal characters.
|
|
342
|
+
"""
|
|
343
|
+
|
|
344
|
+
def __init__(self, fingerprint: str) -> None:
|
|
345
|
+
"""Create a new OpenPGP v4 fingerprint from a string representation.
|
|
346
|
+
|
|
347
|
+
Args:
|
|
348
|
+
fingerprint (str): A string representing the OpenPGP v4 fingerprint,
|
|
349
|
+
which must be exactly 40 uppercase hexadecimal characters.
|
|
350
|
+
|
|
351
|
+
Returns:
|
|
352
|
+
OpenPGPv4Fingerprint: A new instance of OpenPGPv4Fingerprint.
|
|
353
|
+
|
|
354
|
+
Raises:
|
|
355
|
+
ALPMError: If the input string is not a valid OpenPGP v4 fingerprint.
|
|
356
|
+
|
|
357
|
+
"""
|
|
358
|
+
|
|
359
|
+
def __str__(self) -> str: ...
|
|
360
|
+
def __repr__(self) -> str: ...
|
|
361
|
+
def __eq__(self, other: object) -> bool: ...
|
|
362
|
+
|
|
363
|
+
def openpgp_identifier_from_str(
|
|
364
|
+
identifier: str,
|
|
365
|
+
) -> OpenPGPIdentifier:
|
|
366
|
+
"""Create a valid OpenPGPKeyId or OpenPGPv4Fingerprint.
|
|
367
|
+
|
|
368
|
+
Args:
|
|
369
|
+
identifier (str): OpenPGP identifier string, which can be either a key ID or a
|
|
370
|
+
v4 fingerprint.
|
|
371
|
+
|
|
372
|
+
Returns:
|
|
373
|
+
OpenPGPKeyId | OpenPGPv4Fingerprint: A valid OpenPGP identifier object.
|
|
374
|
+
|
|
375
|
+
Raises:
|
|
376
|
+
ALPMError: If the input string isn't a valid OpenPGP key ID or v4 fingerprint.
|
|
377
|
+
|
|
378
|
+
"""
|
|
379
|
+
|
|
380
|
+
class RelativePath:
|
|
381
|
+
"""A representation of a relative file path.
|
|
382
|
+
|
|
383
|
+
Wraps a Path that is guaranteed to represent a relative file path (i.e. it does not
|
|
384
|
+
end with a '/').
|
|
385
|
+
"""
|
|
386
|
+
|
|
387
|
+
def __init__(self, path: Union[Path, str]) -> None:
|
|
388
|
+
"""Create a new relative path.
|
|
389
|
+
|
|
390
|
+
Args:
|
|
391
|
+
path (Path | str): The file path.
|
|
392
|
+
|
|
393
|
+
Raises:
|
|
394
|
+
ALPMError: If the provided string is not a valid relative path.
|
|
395
|
+
|
|
396
|
+
"""
|
|
397
|
+
|
|
398
|
+
def __str__(self) -> str: ...
|
|
399
|
+
def __repr__(self) -> str: ...
|
|
400
|
+
def __eq__(self, other: object) -> bool: ...
|
|
401
|
+
|
|
402
|
+
class UnknownArchitecture:
|
|
403
|
+
"""An unknown but valid CPU architecture."""
|
|
404
|
+
|
|
405
|
+
@property
|
|
406
|
+
def value(self) -> str:
|
|
407
|
+
"""String representation of the unknown architecture."""
|
|
408
|
+
|
|
409
|
+
def __str__(self) -> str: ...
|
|
410
|
+
def __repr__(self) -> str: ...
|
|
411
|
+
def __eq__(self, other: object) -> bool: ...
|
|
412
|
+
def __lt__(self, other: "UnknownArchitecture") -> bool: ...
|
|
413
|
+
def __le__(self, other: "UnknownArchitecture") -> bool: ...
|
|
414
|
+
def __gt__(self, other: "UnknownArchitecture") -> bool: ...
|
|
415
|
+
def __ge__(self, other: "UnknownArchitecture") -> bool: ...
|
|
416
|
+
def __hash__(self) -> int: ...
|
|
417
|
+
|
|
418
|
+
class KnownArchitecture(Enum):
|
|
419
|
+
"""A known, specific CPU architecture."""
|
|
420
|
+
|
|
421
|
+
AARCH64 = "aarch64"
|
|
422
|
+
ARM = "arm"
|
|
423
|
+
ARMV6H = "armv6h"
|
|
424
|
+
ARMV7H = "armv7h"
|
|
425
|
+
I386 = "i386"
|
|
426
|
+
I486 = "i486"
|
|
427
|
+
I686 = "i686"
|
|
428
|
+
PENTIUM4 = "pentium4"
|
|
429
|
+
RISCV32 = "riscv32"
|
|
430
|
+
RISCV64 = "riscv64"
|
|
431
|
+
X86_64 = "x86_64"
|
|
432
|
+
X86_64_V2 = "x86_64_v2"
|
|
433
|
+
X86_64_V3 = "x86_64_v3"
|
|
434
|
+
X86_64_V4 = "x86_64_v4"
|
|
435
|
+
|
|
436
|
+
@property
|
|
437
|
+
def value(self) -> str:
|
|
438
|
+
"""String representation of the known architecture."""
|
|
439
|
+
|
|
440
|
+
def __str__(self) -> str: ...
|
|
441
|
+
def __repr__(self) -> str: ...
|
|
442
|
+
def __eq__(self, other: object) -> bool: ...
|
|
443
|
+
def __lt__(self, other: "KnownArchitecture") -> bool: ...
|
|
444
|
+
def __le__(self, other: "KnownArchitecture") -> bool: ...
|
|
445
|
+
def __gt__(self, other: "KnownArchitecture") -> bool: ...
|
|
446
|
+
def __ge__(self, other: "KnownArchitecture") -> bool: ...
|
|
447
|
+
def __hash__(self) -> int: ...
|
|
448
|
+
|
|
449
|
+
class Architecture:
|
|
450
|
+
"""A valid alpm-architecture."""
|
|
451
|
+
|
|
452
|
+
def __init__(self, arch: Union[KnownArchitecture, str] = "any") -> None:
|
|
453
|
+
"""Create a new Architecture.
|
|
454
|
+
|
|
455
|
+
Args:
|
|
456
|
+
arch (KnownArchitecture | str): Either a known architecture or a string
|
|
457
|
+
consisting of ASCII alphanumeric characters and underscores.
|
|
458
|
+
Defaults to "any".
|
|
459
|
+
|
|
460
|
+
Raises:
|
|
461
|
+
ALPMError: If the provided string is not a valid alpm-architecture.
|
|
462
|
+
|
|
463
|
+
"""
|
|
464
|
+
|
|
465
|
+
@property
|
|
466
|
+
def is_any(self) -> bool:
|
|
467
|
+
"""True if represents any architecture."""
|
|
468
|
+
|
|
469
|
+
@property
|
|
470
|
+
def system_arch(self) -> Optional["SystemArchitecture"]:
|
|
471
|
+
"""Optional system architecture.
|
|
472
|
+
|
|
473
|
+
None if represents any architecture.
|
|
474
|
+
"""
|
|
475
|
+
|
|
476
|
+
def __str__(self) -> str: ...
|
|
477
|
+
def __repr__(self) -> str: ...
|
|
478
|
+
def __eq__(self, other: object) -> bool: ...
|
|
479
|
+
def __lt__(self, other: "Architecture") -> bool: ...
|
|
480
|
+
def __le__(self, other: "Architecture") -> bool: ...
|
|
481
|
+
def __gt__(self, other: "Architecture") -> bool: ...
|
|
482
|
+
def __ge__(self, other: "Architecture") -> bool: ...
|
|
483
|
+
def __hash__(self) -> int: ...
|
|
484
|
+
|
|
485
|
+
class Architectures:
|
|
486
|
+
"""A valid array of compatible alpm-architectures.
|
|
487
|
+
|
|
488
|
+
Iterable over Architecture objects.
|
|
489
|
+
"""
|
|
490
|
+
|
|
491
|
+
def __init__(
|
|
492
|
+
self, architectures: Optional[Sequence[Union[KnownArchitecture, str]]] = None
|
|
493
|
+
) -> None:
|
|
494
|
+
"""Create a new Architectures iterable.
|
|
495
|
+
|
|
496
|
+
Args:
|
|
497
|
+
architectures (Sequence[Union[KnownArchitecture, str]]): A sequence of
|
|
498
|
+
known architectures or strings consisting of ASCII alphanumeric
|
|
499
|
+
characters and underscores. Defaults to None, which is equivalent to
|
|
500
|
+
["any"]. If the sequence contains an "any" architecture, it must be the
|
|
501
|
+
only element.
|
|
502
|
+
|
|
503
|
+
Raises:
|
|
504
|
+
ALPMError: If any of the provided strings is not a valid alpm-architecture
|
|
505
|
+
or if the sequence contains "any" with other architectures.
|
|
506
|
+
|
|
507
|
+
"""
|
|
508
|
+
|
|
509
|
+
@property
|
|
510
|
+
def is_any(self) -> bool:
|
|
511
|
+
"""True if the iterable represents any architecture."""
|
|
512
|
+
|
|
513
|
+
def __iter__(self) -> list[Architecture]: ...
|
|
514
|
+
def __len__(self) -> int: ...
|
|
515
|
+
def __str__(self) -> str: ...
|
|
516
|
+
def __repr__(self) -> str: ...
|
|
517
|
+
def __eq__(self, other: object) -> bool: ...
|
|
518
|
+
def __lt__(self, other: "Architecture") -> bool: ...
|
|
519
|
+
def __le__(self, other: "Architecture") -> bool: ...
|
|
520
|
+
def __gt__(self, other: "Architecture") -> bool: ...
|
|
521
|
+
def __ge__(self, other: "Architecture") -> bool: ...
|
|
522
|
+
def __hash__(self) -> int: ...
|
|
523
|
+
|
|
524
|
+
class Url:
|
|
525
|
+
"""Represents a URL.
|
|
526
|
+
|
|
527
|
+
It is used to represent the upstream URL of a package.
|
|
528
|
+
This type does not yet enforce a secure connection (e.g. HTTPS).
|
|
529
|
+
"""
|
|
530
|
+
|
|
531
|
+
def __init__(self, url: str) -> None:
|
|
532
|
+
"""Create a new Url from a string representation.
|
|
533
|
+
|
|
534
|
+
Args:
|
|
535
|
+
url (str): A string representing URL.
|
|
536
|
+
|
|
537
|
+
Raises:
|
|
538
|
+
ALPMError: If the URL is invalid.
|
|
539
|
+
|
|
540
|
+
"""
|
|
541
|
+
...
|
|
542
|
+
|
|
543
|
+
def __str__(self) -> str: ...
|
|
544
|
+
def __repr__(self) -> str: ...
|
|
545
|
+
def __eq__(self, other: object) -> bool: ...
|
|
546
|
+
|
|
547
|
+
class SourceUrl:
|
|
548
|
+
"""A URL for package sources.
|
|
549
|
+
|
|
550
|
+
Wraps the Url type and provides optional information on VCS systems.
|
|
551
|
+
Can be created from custom URL strings, that in part resemble the default URL
|
|
552
|
+
syntax, e.g.: git+https://example.org/example-project.git#tag=v1.0.0?signed
|
|
553
|
+
"""
|
|
554
|
+
|
|
555
|
+
def __init__(self, source_url: str) -> None:
|
|
556
|
+
"""Create a new SourceUrl from a string representation.
|
|
557
|
+
|
|
558
|
+
Args:
|
|
559
|
+
source_url (str): A string representing SourceUrl.
|
|
560
|
+
|
|
561
|
+
Raises:
|
|
562
|
+
ALPMError: If the value of source_url is invalid.
|
|
563
|
+
|
|
564
|
+
"""
|
|
565
|
+
...
|
|
566
|
+
|
|
567
|
+
@property
|
|
568
|
+
def url(self) -> Url:
|
|
569
|
+
"""The URL from where the sources are retrieved."""
|
|
570
|
+
|
|
571
|
+
@property
|
|
572
|
+
def vcs_info(self) -> VcsInfo:
|
|
573
|
+
"""Optional data on VCS systems using the URL for the retrieval of sources."""
|
|
574
|
+
|
|
575
|
+
def __str__(self) -> str: ...
|
|
576
|
+
def __repr__(self) -> str: ...
|
|
577
|
+
def __eq__(self, other: object) -> bool: ...
|
|
578
|
+
|
|
579
|
+
class BzrInfo:
|
|
580
|
+
"""Bazaar (bzr) VCS information."""
|
|
581
|
+
|
|
582
|
+
@property
|
|
583
|
+
def fragment(self) -> dict[str, str]:
|
|
584
|
+
"""Bzr fragment data."""
|
|
585
|
+
|
|
586
|
+
def __eq__(self, other: object) -> bool: ...
|
|
587
|
+
|
|
588
|
+
class FossilInfo:
|
|
589
|
+
"""Fossil VCS information."""
|
|
590
|
+
|
|
591
|
+
@property
|
|
592
|
+
def fragment(self) -> dict[str, str]:
|
|
593
|
+
"""Fossil fragment data."""
|
|
594
|
+
|
|
595
|
+
def __eq__(self, other: object) -> bool: ...
|
|
596
|
+
|
|
597
|
+
class GitInfo:
|
|
598
|
+
"""Git VCS information."""
|
|
599
|
+
|
|
600
|
+
@property
|
|
601
|
+
def fragment(self) -> dict[str, str]:
|
|
602
|
+
"""Git fragment data."""
|
|
603
|
+
|
|
604
|
+
@property
|
|
605
|
+
def signed(self) -> bool:
|
|
606
|
+
"""True if the OpenPGP signature should be verified."""
|
|
607
|
+
|
|
608
|
+
def __eq__(self, other: object) -> bool: ...
|
|
609
|
+
|
|
610
|
+
class HgInfo:
|
|
611
|
+
"""Mercurial (hg) VCS information."""
|
|
612
|
+
|
|
613
|
+
@property
|
|
614
|
+
def fragment(self) -> dict[str, str]:
|
|
615
|
+
"""Hg fragment data."""
|
|
616
|
+
|
|
617
|
+
def __eq__(self, other: object) -> bool: ...
|
|
618
|
+
|
|
619
|
+
class SvnInfo:
|
|
620
|
+
"""Subversion (svn) VCS information."""
|
|
621
|
+
|
|
622
|
+
@property
|
|
623
|
+
def fragment(self) -> dict[str, str]:
|
|
624
|
+
"""Svn fragment data."""
|
|
625
|
+
|
|
626
|
+
def __eq__(self, other: object) -> bool: ...
|
|
627
|
+
|
|
628
|
+
class Source:
|
|
629
|
+
"""Represents the location that a source file should be retrieved from.
|
|
630
|
+
|
|
631
|
+
It can be either a local file (next to the PKGBUILD) or a URL.
|
|
632
|
+
"""
|
|
633
|
+
|
|
634
|
+
def __init__(self, source: str):
|
|
635
|
+
"""Create a new Source from a string representation.
|
|
636
|
+
|
|
637
|
+
Args:
|
|
638
|
+
source (str): A string representing the source. It is either a filename (in
|
|
639
|
+
the same directory as the PKGBUILD) or a url, optionally prefixed by a
|
|
640
|
+
destination file name (separated by "::").
|
|
641
|
+
|
|
642
|
+
Raises:
|
|
643
|
+
ALPMError: If the source string is invalid.
|
|
644
|
+
|
|
645
|
+
"""
|
|
646
|
+
|
|
647
|
+
@property
|
|
648
|
+
def filename(self) -> Optional[Path]:
|
|
649
|
+
"""The filename of the source, if it is set."""
|
|
650
|
+
|
|
651
|
+
@property
|
|
652
|
+
def source_url(self) -> Optional[SourceUrl]:
|
|
653
|
+
"""The source URL."""
|
|
654
|
+
|
|
655
|
+
@property
|
|
656
|
+
def location(self) -> Optional[Path]:
|
|
657
|
+
"""The source file name."""
|
|
658
|
+
|
|
659
|
+
def __str__(self) -> str: ...
|
|
660
|
+
def __repr__(self) -> str: ...
|
|
661
|
+
def __eq__(self, other: object) -> bool: ...
|
|
662
|
+
|
|
663
|
+
class Epoch:
|
|
664
|
+
"""An epoch of a package.
|
|
665
|
+
|
|
666
|
+
Epoch is used to indicate the downgrade of a package and is prepended to a version,
|
|
667
|
+
delimited by a ':' (e.g. '1:' is added to '0.10.0-1' to form '1:0.10.0-1' which
|
|
668
|
+
then orders newer than '1.0.0-1').
|
|
669
|
+
|
|
670
|
+
An Epoch wraps an int that is guaranteed to be greater than 0.
|
|
671
|
+
"""
|
|
672
|
+
|
|
673
|
+
def __init__(self, value: int) -> None:
|
|
674
|
+
"""Create a new epoch from a positive integer.
|
|
675
|
+
|
|
676
|
+
Args:
|
|
677
|
+
value (int): The epoch value, must be a non-zero positive integer.
|
|
678
|
+
|
|
679
|
+
Raises:
|
|
680
|
+
ValueError: If the epoch is not a positive integer.
|
|
681
|
+
OverflowError: If the epoch is greater than the system's pointer size.
|
|
682
|
+
|
|
683
|
+
"""
|
|
684
|
+
|
|
685
|
+
@staticmethod
|
|
686
|
+
def from_str(epoch: str) -> "Epoch":
|
|
687
|
+
"""Create a new Epoch from a string representation.
|
|
688
|
+
|
|
689
|
+
Args:
|
|
690
|
+
epoch (str): The string representation of the epoch.
|
|
691
|
+
|
|
692
|
+
Returns:
|
|
693
|
+
Epoch: A new instance of Epoch.
|
|
694
|
+
|
|
695
|
+
Raises:
|
|
696
|
+
ALPMError: If the string cannot be parsed as a valid epoch.
|
|
697
|
+
|
|
698
|
+
"""
|
|
699
|
+
|
|
700
|
+
@property
|
|
701
|
+
def value(self) -> int:
|
|
702
|
+
"""Epoch value as an integer."""
|
|
703
|
+
|
|
704
|
+
def __str__(self) -> str: ...
|
|
705
|
+
def __repr__(self) -> str: ...
|
|
706
|
+
def __eq__(self, other: object) -> bool: ...
|
|
707
|
+
def __lt__(self, other: "Epoch") -> bool: ...
|
|
708
|
+
def __le__(self, other: "Epoch") -> bool: ...
|
|
709
|
+
def __gt__(self, other: "Epoch") -> bool: ...
|
|
710
|
+
def __ge__(self, other: "Epoch") -> bool: ...
|
|
711
|
+
|
|
712
|
+
class PackageRelease:
|
|
713
|
+
"""The release version of a package.
|
|
714
|
+
|
|
715
|
+
Wraps int for its major version and Optional[int] for its minor version.
|
|
716
|
+
|
|
717
|
+
Used to indicate the build version of a package.
|
|
718
|
+
"""
|
|
719
|
+
|
|
720
|
+
def __init__(self, major: int = 0, minor: Optional[int] = None) -> None:
|
|
721
|
+
"""Create a new package release.
|
|
722
|
+
|
|
723
|
+
Args:
|
|
724
|
+
major (int): The major version of the package release.
|
|
725
|
+
minor (Optional[int]): The minor version of the package release, defaults
|
|
726
|
+
to None
|
|
727
|
+
|
|
728
|
+
Raises:
|
|
729
|
+
OverflowError: If the major or minor version is negative or greater than
|
|
730
|
+
the system's pointer size.
|
|
731
|
+
|
|
732
|
+
"""
|
|
733
|
+
|
|
734
|
+
@staticmethod
|
|
735
|
+
def from_str(version: str) -> "PackageRelease":
|
|
736
|
+
"""Create a PackageRelease from a string representation.
|
|
737
|
+
|
|
738
|
+
Args:
|
|
739
|
+
version: (str): The string representation of the package release.
|
|
740
|
+
|
|
741
|
+
Returns:
|
|
742
|
+
PackageRelease: A new instance of PackageRelease.
|
|
743
|
+
|
|
744
|
+
Raises:
|
|
745
|
+
ALPMError: If the string cannot be parsed as a valid package release.
|
|
746
|
+
|
|
747
|
+
"""
|
|
748
|
+
|
|
749
|
+
@property
|
|
750
|
+
def major(self) -> int:
|
|
751
|
+
"""Major version of the package release."""
|
|
752
|
+
|
|
753
|
+
@property
|
|
754
|
+
def minor(self) -> Optional[int]:
|
|
755
|
+
"""Minor version of the package release, if available."""
|
|
756
|
+
|
|
757
|
+
def __str__(self) -> str: ...
|
|
758
|
+
def __repr__(self) -> str: ...
|
|
759
|
+
def __eq__(self, other: object) -> bool: ...
|
|
760
|
+
|
|
761
|
+
class PackageVersion:
|
|
762
|
+
"""A pkgver of a package.
|
|
763
|
+
|
|
764
|
+
Used to denote the upstream version of a package.
|
|
765
|
+
|
|
766
|
+
Wraps a string, which is guaranteed to only contain alphanumeric characters, '_',
|
|
767
|
+
'+'` or '.', but to not start with a '_', a '+' or a '.' character and to be at
|
|
768
|
+
least one char long.
|
|
769
|
+
|
|
770
|
+
NOTE: This implementation of PackageVersion is stricter than that of
|
|
771
|
+
libalpm/pacman. It does not allow empty strings '', or chars that are not in the
|
|
772
|
+
allowed set, or '.' as the first character.
|
|
773
|
+
"""
|
|
774
|
+
|
|
775
|
+
def __init__(self, pkgver: str) -> None:
|
|
776
|
+
"""Create a new package version from a string representation.
|
|
777
|
+
|
|
778
|
+
Args:
|
|
779
|
+
pkgver: (str): The package version string, must be a valid pkgver.
|
|
780
|
+
|
|
781
|
+
Raises:
|
|
782
|
+
ALPMError: If the pkgver is not a valid pkgver string.
|
|
783
|
+
|
|
784
|
+
"""
|
|
785
|
+
...
|
|
786
|
+
|
|
787
|
+
def __str__(self) -> str: ...
|
|
788
|
+
def __repr__(self) -> str: ...
|
|
789
|
+
def __eq__(self, other: object) -> bool: ...
|
|
790
|
+
def __lt__(self, other: "PackageVersion") -> bool: ...
|
|
791
|
+
def __le__(self, other: "PackageVersion") -> bool: ...
|
|
792
|
+
def __gt__(self, other: "PackageVersion") -> bool: ...
|
|
793
|
+
def __ge__(self, other: "PackageVersion") -> bool: ...
|
|
794
|
+
|
|
795
|
+
class SchemaVersion:
|
|
796
|
+
"""The schema version of a type.
|
|
797
|
+
|
|
798
|
+
Wraps a semver version. However, for backwards compatibility reasons it is possible
|
|
799
|
+
to initialize a SchemaVersion using a non-semver compatible string, if it can be
|
|
800
|
+
parsed to a single 64-bit unsigned integer (e.g. '1').
|
|
801
|
+
"""
|
|
802
|
+
|
|
803
|
+
def __init__(
|
|
804
|
+
self,
|
|
805
|
+
major: int = 0,
|
|
806
|
+
minor: int = 0,
|
|
807
|
+
patch: int = 0,
|
|
808
|
+
pre: str = "",
|
|
809
|
+
build: str = "",
|
|
810
|
+
) -> None:
|
|
811
|
+
"""Create a new schema version.
|
|
812
|
+
|
|
813
|
+
Args:
|
|
814
|
+
major (int): The major version number.
|
|
815
|
+
minor (int): The minor version number.
|
|
816
|
+
patch (int): The patch version number.
|
|
817
|
+
pre (str): Optional pre-release identifier on a version string. This comes
|
|
818
|
+
after '-' in a semver version, like '1.0.0-alpha.1'.
|
|
819
|
+
build (str): Optional build metadata identifier. This comes after '+' in a
|
|
820
|
+
semver version, as in '0.8.1+zstd.1.5.0'.
|
|
821
|
+
|
|
822
|
+
Raises:
|
|
823
|
+
ALPMError: If the pre-release or build metadata cannot be parsed.
|
|
824
|
+
OverflowError: If the major, minor, or patch version is greater than
|
|
825
|
+
2^64 - 1 or negative.
|
|
826
|
+
|
|
827
|
+
"""
|
|
828
|
+
|
|
829
|
+
@staticmethod
|
|
830
|
+
def from_str(version: str) -> "SchemaVersion":
|
|
831
|
+
"""Create a SchemaVersion from a string representation.
|
|
832
|
+
|
|
833
|
+
Args:
|
|
834
|
+
version (str): The string representation of the schema version.
|
|
835
|
+
|
|
836
|
+
Returns:
|
|
837
|
+
SchemaVersion: A new instance of SchemaVersion.
|
|
838
|
+
|
|
839
|
+
Raises:
|
|
840
|
+
ALPMError: If the string cannot be parsed as a valid schema version.
|
|
841
|
+
|
|
842
|
+
"""
|
|
843
|
+
|
|
844
|
+
@property
|
|
845
|
+
def major(self) -> int:
|
|
846
|
+
"""Major version number of the schema version."""
|
|
847
|
+
|
|
848
|
+
@property
|
|
849
|
+
def minor(self) -> int:
|
|
850
|
+
"""Minor version number of the schema version."""
|
|
851
|
+
|
|
852
|
+
@property
|
|
853
|
+
def patch(self) -> int:
|
|
854
|
+
"""Patch version number of the schema version."""
|
|
855
|
+
|
|
856
|
+
@property
|
|
857
|
+
def pre(self) -> str:
|
|
858
|
+
"""Pre-release identifier of the schema version."""
|
|
859
|
+
|
|
860
|
+
@property
|
|
861
|
+
def build(self) -> str:
|
|
862
|
+
"""Build metadata identifier of the schema version."""
|
|
863
|
+
|
|
864
|
+
def __str__(self) -> str: ...
|
|
865
|
+
def __repr__(self) -> str: ...
|
|
866
|
+
def __eq__(self, other: object) -> bool: ...
|
|
867
|
+
def __lt__(self, other: "SchemaVersion") -> bool: ...
|
|
868
|
+
def __le__(self, other: "SchemaVersion") -> bool: ...
|
|
869
|
+
def __gt__(self, other: "SchemaVersion") -> bool: ...
|
|
870
|
+
def __ge__(self, other: "SchemaVersion") -> bool: ...
|
|
871
|
+
|
|
872
|
+
class OptionalDependency:
|
|
873
|
+
"""An optional dependency for a package.
|
|
874
|
+
|
|
875
|
+
This type is used for representing dependencies that are not essential for base
|
|
876
|
+
functionality of a package, but may be necessary to make use of certain features
|
|
877
|
+
of a package.
|
|
878
|
+
|
|
879
|
+
An OptionalDependency consists of a package relation and an optional description
|
|
880
|
+
separated by a colon (':'). The package relation component must be a valid
|
|
881
|
+
PackageRelation. If a description is provided it must be at least one character
|
|
882
|
+
long.
|
|
883
|
+
"""
|
|
884
|
+
|
|
885
|
+
def __init__(
|
|
886
|
+
self, package_relation: "PackageRelation", description: Optional[str] = None
|
|
887
|
+
):
|
|
888
|
+
"""Create a new optional dependency.
|
|
889
|
+
|
|
890
|
+
Args:
|
|
891
|
+
package_relation (PackageRelation): The package relation of the optional
|
|
892
|
+
dependency.
|
|
893
|
+
description (Optional[str]): An optional description of the dependency.
|
|
894
|
+
|
|
895
|
+
"""
|
|
896
|
+
|
|
897
|
+
@staticmethod
|
|
898
|
+
def from_str(s: str) -> "OptionalDependency":
|
|
899
|
+
"""Create a new OptionalDependency from a string representation.
|
|
900
|
+
|
|
901
|
+
Args:
|
|
902
|
+
s (str): The string representation of the optional dependency.
|
|
903
|
+
|
|
904
|
+
Returns:
|
|
905
|
+
OptionalDependency: A new instance of OptionalDependency.
|
|
906
|
+
|
|
907
|
+
Raises:
|
|
908
|
+
ALPMError: If the string cannot be parsed as a valid optional dependency.
|
|
909
|
+
|
|
910
|
+
"""
|
|
911
|
+
|
|
912
|
+
@property
|
|
913
|
+
def name(self) -> str:
|
|
914
|
+
"""Name of the optional dependency."""
|
|
915
|
+
|
|
916
|
+
@property
|
|
917
|
+
def version_requirement(self) -> Optional["VersionRequirement"]:
|
|
918
|
+
"""Version requirement of the optional dependency, if any."""
|
|
919
|
+
|
|
920
|
+
@property
|
|
921
|
+
def description(self) -> Optional[str]:
|
|
922
|
+
"""Description of the optional dependency, if any."""
|
|
923
|
+
|
|
924
|
+
def __str__(self) -> str: ...
|
|
925
|
+
def __repr__(self) -> str: ...
|
|
926
|
+
def __eq__(self, other: object) -> bool: ...
|
|
927
|
+
|
|
928
|
+
class PackageRelation:
|
|
929
|
+
"""A package relation.
|
|
930
|
+
|
|
931
|
+
Describes a relation to a component.
|
|
932
|
+
Package relations may either consist of only a name or of a name and a
|
|
933
|
+
version_requirement.
|
|
934
|
+
"""
|
|
935
|
+
|
|
936
|
+
def __init__(
|
|
937
|
+
self, name: str, version_requirement: Optional["VersionRequirement"] = None
|
|
938
|
+
):
|
|
939
|
+
"""Create a new package relation.
|
|
940
|
+
|
|
941
|
+
Args:
|
|
942
|
+
name (str): The name of the package.
|
|
943
|
+
version_requirement (Optional[VersionRequirement]): An optional version
|
|
944
|
+
requirement for the package.
|
|
945
|
+
|
|
946
|
+
Raises:
|
|
947
|
+
ALPMError: If the name is invalid.
|
|
948
|
+
|
|
949
|
+
"""
|
|
950
|
+
|
|
951
|
+
@property
|
|
952
|
+
def name(self) -> str:
|
|
953
|
+
"""Name of the package."""
|
|
954
|
+
|
|
955
|
+
@property
|
|
956
|
+
def version_requirement(self) -> Optional["VersionRequirement"]:
|
|
957
|
+
"""Version requirement of the package, if any."""
|
|
958
|
+
|
|
959
|
+
def __str__(self) -> str: ...
|
|
960
|
+
def __repr__(self) -> str: ...
|
|
961
|
+
def __eq__(self, other: object) -> bool: ...
|
|
962
|
+
|
|
963
|
+
class SonameV1Type(Enum):
|
|
964
|
+
"""The form of a SonameV1."""
|
|
965
|
+
|
|
966
|
+
BASIC = ("BASIC",)
|
|
967
|
+
UNVERSIONED = ("UNVERSIONED",)
|
|
968
|
+
EXPLICIT = ("EXPLICIT",)
|
|
969
|
+
|
|
970
|
+
class SonameV1:
|
|
971
|
+
"""Soname data of a shared object based on the alpm-sonamev1 specification.
|
|
972
|
+
|
|
973
|
+
This type is deprecated and SonameV2 should be preferred instead! Due to the
|
|
974
|
+
loose nature of the alpm-sonamev1 specification, the basic form overlaps with the
|
|
975
|
+
specification of Name and the explicit form overlaps with that of PackageRelation.
|
|
976
|
+
"""
|
|
977
|
+
|
|
978
|
+
def __init__(
|
|
979
|
+
self,
|
|
980
|
+
name: str,
|
|
981
|
+
version_or_soname: Optional[VersionOrSoname] = None,
|
|
982
|
+
architecture: Optional["ElfArchitectureFormat"] = None,
|
|
983
|
+
):
|
|
984
|
+
"""Create a new SonameV1.
|
|
985
|
+
|
|
986
|
+
Depending on input, returns different forms of SonameV1:
|
|
987
|
+
BASIC, if both version_or_soname and architecture are None
|
|
988
|
+
UNVERSIONED, if version_or_soname is a str and architecture is not None
|
|
989
|
+
EXPLICIT, if version_or_soname is a PackageVersion and architecture is not None
|
|
990
|
+
|
|
991
|
+
Args:
|
|
992
|
+
name (str): The name of the shared object.
|
|
993
|
+
version_or_soname (Optional[VersionOrSoname]): The package version
|
|
994
|
+
(forexplicit form) or soname (for unversioned form) of the shared
|
|
995
|
+
object.
|
|
996
|
+
architecture (Optional[ElfArchitectureFormat]): The architecture of the
|
|
997
|
+
shared object, only for unversioned or explicit forms.
|
|
998
|
+
|
|
999
|
+
Raises:
|
|
1000
|
+
ALPMError: If the input is invalid.
|
|
1001
|
+
|
|
1002
|
+
"""
|
|
1003
|
+
|
|
1004
|
+
@property
|
|
1005
|
+
def name(self) -> str:
|
|
1006
|
+
"""The least specific name of the shared object file."""
|
|
1007
|
+
|
|
1008
|
+
@property
|
|
1009
|
+
def soname(self) -> Optional[str]:
|
|
1010
|
+
"""The value of the shared object's SONAME field in its dynamic section.
|
|
1011
|
+
|
|
1012
|
+
Available only for unversioned form.
|
|
1013
|
+
"""
|
|
1014
|
+
|
|
1015
|
+
@property
|
|
1016
|
+
def version(self) -> Optional["PackageVersion"]:
|
|
1017
|
+
"""The version of the shared object file (as exposed in its _soname_ data).
|
|
1018
|
+
|
|
1019
|
+
Available only for explicit form.
|
|
1020
|
+
"""
|
|
1021
|
+
|
|
1022
|
+
@property
|
|
1023
|
+
def architecture(self) -> Optional["ElfArchitectureFormat"]:
|
|
1024
|
+
"""The ELF architecture format of the shared object file.
|
|
1025
|
+
|
|
1026
|
+
Not available for basic form.
|
|
1027
|
+
"""
|
|
1028
|
+
|
|
1029
|
+
@property
|
|
1030
|
+
def form(self) -> "SonameV1Type":
|
|
1031
|
+
"""The form of this SonameV1."""
|
|
1032
|
+
|
|
1033
|
+
def __str__(self) -> str: ...
|
|
1034
|
+
def __repr__(self) -> str: ...
|
|
1035
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1036
|
+
|
|
1037
|
+
def relation_or_soname_from_str(s: str) -> RelationOrSoname:
|
|
1038
|
+
"""Parse a string into either a PackageRelation or a SonameV1.
|
|
1039
|
+
|
|
1040
|
+
Args:
|
|
1041
|
+
s (str): The string representation of PackageRelation or SonameV1.
|
|
1042
|
+
|
|
1043
|
+
Returns:
|
|
1044
|
+
RelationOrSoname: A valid PackageRelation or SonameV1 object.
|
|
1045
|
+
|
|
1046
|
+
Raises:
|
|
1047
|
+
ALPMError: If the input string can't be parsed to a valid PackageRelation or
|
|
1048
|
+
SonameV1.
|
|
1049
|
+
|
|
1050
|
+
"""
|
|
1051
|
+
|
|
1052
|
+
class VersionComparison(Enum):
|
|
1053
|
+
"""Specifies the comparison function for a VersionRequirement.
|
|
1054
|
+
|
|
1055
|
+
The package version can be required to be:
|
|
1056
|
+
- less than ('<')
|
|
1057
|
+
- less than or equal to ('<=')
|
|
1058
|
+
- equal to ('=')
|
|
1059
|
+
- greater than or equal to ('>=')
|
|
1060
|
+
- greater than ('>')
|
|
1061
|
+
the specified version.
|
|
1062
|
+
"""
|
|
1063
|
+
|
|
1064
|
+
LESS_OR_EQUAL = ("<=",)
|
|
1065
|
+
GREATER_OR_EQUAL = (">=",)
|
|
1066
|
+
EQUAL = ("=",)
|
|
1067
|
+
LESS = ("<",)
|
|
1068
|
+
GREATER = (">",)
|
|
1069
|
+
|
|
1070
|
+
@staticmethod
|
|
1071
|
+
def from_str(comparison: str) -> "VersionComparison":
|
|
1072
|
+
"""Parse a version comparison string into a VersionComparison enum variant.
|
|
1073
|
+
|
|
1074
|
+
Args:
|
|
1075
|
+
comparison (str): The version comparison string to parse. Must be one of
|
|
1076
|
+
'<', '<=', '=', '>=', '>'.
|
|
1077
|
+
|
|
1078
|
+
Returns:
|
|
1079
|
+
VersionComparison: The corresponding VersionComparison enum variant.
|
|
1080
|
+
|
|
1081
|
+
Raises:
|
|
1082
|
+
ALPMError: If the input string doesn't match any known comparison.
|
|
1083
|
+
|
|
1084
|
+
"""
|
|
1085
|
+
|
|
1086
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1087
|
+
|
|
1088
|
+
class VersionRequirement:
|
|
1089
|
+
"""A version requirement, e.g. for a dependency package.
|
|
1090
|
+
|
|
1091
|
+
It consists of a target version and a VersionComparison. A version requirement of
|
|
1092
|
+
'>=1.5' has a target version of '1.5' and a comparison function of
|
|
1093
|
+
VersionComparison.GREATER_OR_EQUAL.
|
|
1094
|
+
"""
|
|
1095
|
+
|
|
1096
|
+
def __init__(self, comparison: "VersionComparison", version: "Version") -> None:
|
|
1097
|
+
"""Create a new version requirement.
|
|
1098
|
+
|
|
1099
|
+
Args:
|
|
1100
|
+
comparison (VersionComparison): The comparison function.
|
|
1101
|
+
version (Version): The version.
|
|
1102
|
+
|
|
1103
|
+
"""
|
|
1104
|
+
|
|
1105
|
+
@staticmethod
|
|
1106
|
+
def from_str(s: str) -> "VersionRequirement":
|
|
1107
|
+
"""Create a new VersionRequirement from a string representation.
|
|
1108
|
+
|
|
1109
|
+
Args:
|
|
1110
|
+
s (str): The string representation of the version requirement.
|
|
1111
|
+
|
|
1112
|
+
Returns:
|
|
1113
|
+
VersionRequirement: A new instance of VersionRequirement.
|
|
1114
|
+
|
|
1115
|
+
Raises:
|
|
1116
|
+
ALPMError: If the string cannot be parsed as a valid version requirement.
|
|
1117
|
+
|
|
1118
|
+
"""
|
|
1119
|
+
|
|
1120
|
+
def is_satisfied_by(self, ver: "Version") -> bool:
|
|
1121
|
+
"""Return True if the requirement is satisfied by the given package version.
|
|
1122
|
+
|
|
1123
|
+
Args:
|
|
1124
|
+
ver (Version): The version to check.
|
|
1125
|
+
|
|
1126
|
+
Returns:
|
|
1127
|
+
bool: True if the version satisfies the requirement, False otherwise.
|
|
1128
|
+
|
|
1129
|
+
"""
|
|
1130
|
+
|
|
1131
|
+
def __str__(self) -> str: ...
|
|
1132
|
+
def __repr__(self) -> str: ...
|
|
1133
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1134
|
+
|
|
1135
|
+
class ElfArchitectureFormat(Enum):
|
|
1136
|
+
"""ELF architecture format.
|
|
1137
|
+
|
|
1138
|
+
This enum represents the Class field in the ELF Header.
|
|
1139
|
+
"""
|
|
1140
|
+
|
|
1141
|
+
BIT_32 = ("32",)
|
|
1142
|
+
BIT_64 = ("64",)
|
|
1143
|
+
|
|
1144
|
+
@staticmethod
|
|
1145
|
+
def from_str(format: str) -> "ElfArchitectureFormat":
|
|
1146
|
+
"""Parse an ELF architecture format string into an ElfArchitectureFormat.
|
|
1147
|
+
|
|
1148
|
+
Args:
|
|
1149
|
+
format (str): The ELF architecture format string to parse. Must be one of
|
|
1150
|
+
'32' or '64'.
|
|
1151
|
+
|
|
1152
|
+
Returns:
|
|
1153
|
+
ElfArchitectureFormat: The corresponding ElfArchitectureFormat enum variant.
|
|
1154
|
+
|
|
1155
|
+
Raises:
|
|
1156
|
+
ValueError: If the input string doesn't match any known format.
|
|
1157
|
+
|
|
1158
|
+
"""
|
|
1159
|
+
|
|
1160
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1161
|
+
def __hash__(self) -> int: ...
|
|
1162
|
+
|
|
1163
|
+
class FullVersion:
|
|
1164
|
+
"""A package version with mandatory PackageRelease.
|
|
1165
|
+
|
|
1166
|
+
Tracks an optional Epoch, a PackageVersion and a PackageRelease. This reflects the
|
|
1167
|
+
'full' and 'full with epoch' forms of alpm-package-version.
|
|
1168
|
+
"""
|
|
1169
|
+
|
|
1170
|
+
def __init__(
|
|
1171
|
+
self,
|
|
1172
|
+
pkgver: "PackageVersion",
|
|
1173
|
+
pkgrel: "PackageRelease",
|
|
1174
|
+
epoch: Optional["Epoch"] = None,
|
|
1175
|
+
) -> None:
|
|
1176
|
+
"""Create a new FullVersion.
|
|
1177
|
+
|
|
1178
|
+
Args:
|
|
1179
|
+
pkgver (PackageVersion): The package version.
|
|
1180
|
+
pkgrel (PackageRelease): The package release.
|
|
1181
|
+
epoch (Optional[Epoch]): The epoch, if any.
|
|
1182
|
+
|
|
1183
|
+
"""
|
|
1184
|
+
|
|
1185
|
+
@staticmethod
|
|
1186
|
+
def from_str(version: str) -> "FullVersion":
|
|
1187
|
+
"""Create a FullVersion from a string representation.
|
|
1188
|
+
|
|
1189
|
+
Args:
|
|
1190
|
+
version (str): The string representation of the full version.
|
|
1191
|
+
|
|
1192
|
+
Returns:
|
|
1193
|
+
FullVersion: A new instance of FullVersion.
|
|
1194
|
+
|
|
1195
|
+
Raises:
|
|
1196
|
+
ALPMError: If the string cannot be parsed as a valid full version.
|
|
1197
|
+
|
|
1198
|
+
"""
|
|
1199
|
+
|
|
1200
|
+
@property
|
|
1201
|
+
def pkgver(self) -> "PackageVersion":
|
|
1202
|
+
"""The package version."""
|
|
1203
|
+
|
|
1204
|
+
@property
|
|
1205
|
+
def pkgrel(self) -> "PackageRelease":
|
|
1206
|
+
"""The package release."""
|
|
1207
|
+
|
|
1208
|
+
@property
|
|
1209
|
+
def epoch(self) -> Optional["Epoch"]:
|
|
1210
|
+
"""The epoch, if any."""
|
|
1211
|
+
|
|
1212
|
+
def vercmp(self, other: "FullVersion") -> int:
|
|
1213
|
+
"""Compare this FullVersion with another FullVersion.
|
|
1214
|
+
|
|
1215
|
+
Output behavior is based on the behavior of the vercmp tool.
|
|
1216
|
+
|
|
1217
|
+
Args:
|
|
1218
|
+
other (FullVersion): The other FullVersion to compare against.
|
|
1219
|
+
|
|
1220
|
+
Returns:
|
|
1221
|
+
int: 1 if self is newer than other,
|
|
1222
|
+
0 if they are equal,
|
|
1223
|
+
-1 if self is older than other.
|
|
1224
|
+
|
|
1225
|
+
"""
|
|
1226
|
+
|
|
1227
|
+
def __str__(self) -> str: ...
|
|
1228
|
+
def __repr__(self) -> str: ...
|
|
1229
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1230
|
+
def __lt__(self, other: "FullVersion") -> bool: ...
|
|
1231
|
+
def __le__(self, other: "FullVersion") -> bool: ...
|
|
1232
|
+
def __gt__(self, other: "FullVersion") -> bool: ...
|
|
1233
|
+
def __ge__(self, other: "FullVersion") -> bool: ...
|
|
1234
|
+
|
|
1235
|
+
class Version:
|
|
1236
|
+
"""A version of a package.
|
|
1237
|
+
|
|
1238
|
+
A Version generically tracks an optional Epoch, a PackageVersion and an optional
|
|
1239
|
+
PackageRelease.
|
|
1240
|
+
"""
|
|
1241
|
+
|
|
1242
|
+
def __init__(
|
|
1243
|
+
self,
|
|
1244
|
+
pkgver: "PackageVersion",
|
|
1245
|
+
pkgrel: Optional["PackageRelease"] = None,
|
|
1246
|
+
epoch: Optional["Epoch"] = None,
|
|
1247
|
+
) -> None:
|
|
1248
|
+
"""Create a new Version.
|
|
1249
|
+
|
|
1250
|
+
Args:
|
|
1251
|
+
pkgver (PackageVersion): The package version.
|
|
1252
|
+
pkgrel (Optional[PackageRelease]): The package release, if any.
|
|
1253
|
+
epoch (Optional[Epoch]): The epoch, if any.
|
|
1254
|
+
|
|
1255
|
+
"""
|
|
1256
|
+
|
|
1257
|
+
@staticmethod
|
|
1258
|
+
def from_str(version: str) -> "Version":
|
|
1259
|
+
"""Create a FullVersion from a string representation.
|
|
1260
|
+
|
|
1261
|
+
Args:
|
|
1262
|
+
version (str): The string representation of the full version.
|
|
1263
|
+
|
|
1264
|
+
Returns:
|
|
1265
|
+
FullVersion: A new instance of FullVersion.
|
|
1266
|
+
|
|
1267
|
+
Raises:
|
|
1268
|
+
ALPMError: If the string cannot be parsed as a valid full version.
|
|
1269
|
+
|
|
1270
|
+
"""
|
|
1271
|
+
|
|
1272
|
+
@property
|
|
1273
|
+
def pkgver(self) -> "PackageVersion":
|
|
1274
|
+
"""The package version."""
|
|
1275
|
+
|
|
1276
|
+
@property
|
|
1277
|
+
def pkgrel(self) -> Optional["PackageRelease"]:
|
|
1278
|
+
"""The package release, if any."""
|
|
1279
|
+
|
|
1280
|
+
@property
|
|
1281
|
+
def epoch(self) -> Optional["Epoch"]:
|
|
1282
|
+
"""The epoch, if any."""
|
|
1283
|
+
|
|
1284
|
+
def vercmp(self, other: "Version") -> int:
|
|
1285
|
+
"""Compare this Version with another Version.
|
|
1286
|
+
|
|
1287
|
+
Output behavior is based on the behavior of the vercmp tool.
|
|
1288
|
+
|
|
1289
|
+
Args:
|
|
1290
|
+
other (Version): The other Version to compare against.
|
|
1291
|
+
|
|
1292
|
+
Returns:
|
|
1293
|
+
int: 1 if self is newer than other,
|
|
1294
|
+
0 if they are equal,
|
|
1295
|
+
-1 if self is older than other.
|
|
1296
|
+
|
|
1297
|
+
"""
|
|
1298
|
+
|
|
1299
|
+
def __str__(self) -> str: ...
|
|
1300
|
+
def __repr__(self) -> str: ...
|
|
1301
|
+
def __eq__(self, other: object) -> bool: ...
|
|
1302
|
+
def __lt__(self, other: "Version") -> bool: ...
|
|
1303
|
+
def __le__(self, other: "Version") -> bool: ...
|
|
1304
|
+
def __gt__(self, other: "Version") -> bool: ...
|
|
1305
|
+
def __ge__(self, other: "Version") -> bool: ...
|
|
1306
|
+
|
|
1307
|
+
__all__ = [
|
|
1308
|
+
"ALPMError",
|
|
1309
|
+
"Blake2b512Checksum",
|
|
1310
|
+
"Md5Checksum",
|
|
1311
|
+
"Sha1Checksum",
|
|
1312
|
+
"Sha224Checksum",
|
|
1313
|
+
"Sha256Checksum",
|
|
1314
|
+
"Sha384Checksum",
|
|
1315
|
+
"Sha512Checksum",
|
|
1316
|
+
"SkippableBlake2b512Checksum",
|
|
1317
|
+
"SkippableMd5Checksum",
|
|
1318
|
+
"SkippableSha1Checksum",
|
|
1319
|
+
"SkippableSha224Checksum",
|
|
1320
|
+
"SkippableSha256Checksum",
|
|
1321
|
+
"SkippableSha384Checksum",
|
|
1322
|
+
"SkippableSha512Checksum",
|
|
1323
|
+
"BuildEnvironmentOption",
|
|
1324
|
+
"PackageOption",
|
|
1325
|
+
"makepkg_option_from_str",
|
|
1326
|
+
"License",
|
|
1327
|
+
"OpenPGPKeyId",
|
|
1328
|
+
"OpenPGPv4Fingerprint",
|
|
1329
|
+
"openpgp_identifier_from_str",
|
|
1330
|
+
"RelativePath",
|
|
1331
|
+
"UnknownArchitecture",
|
|
1332
|
+
"KnownArchitecture",
|
|
1333
|
+
"Architecture",
|
|
1334
|
+
"Architectures",
|
|
1335
|
+
"Url",
|
|
1336
|
+
"SourceUrl",
|
|
1337
|
+
"BzrInfo",
|
|
1338
|
+
"FossilInfo",
|
|
1339
|
+
"GitInfo",
|
|
1340
|
+
"HgInfo",
|
|
1341
|
+
"SvnInfo",
|
|
1342
|
+
"Source",
|
|
1343
|
+
"Epoch",
|
|
1344
|
+
"PackageRelease",
|
|
1345
|
+
"PackageVersion",
|
|
1346
|
+
"SchemaVersion",
|
|
1347
|
+
"OptionalDependency",
|
|
1348
|
+
"PackageRelation",
|
|
1349
|
+
"SonameV1",
|
|
1350
|
+
"SonameV1Type",
|
|
1351
|
+
"relation_or_soname_from_str",
|
|
1352
|
+
"VersionComparison",
|
|
1353
|
+
"VersionRequirement",
|
|
1354
|
+
"ElfArchitectureFormat",
|
|
1355
|
+
"FullVersion",
|
|
1356
|
+
"Version",
|
|
1357
|
+
]
|