-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.py
More file actions
81 lines (63 loc) · 2.51 KB
/
schema.py
File metadata and controls
81 lines (63 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""Definitions for the plugin"""
from pathlib import Path
from typing import Annotated
from pydantic import Field, HttpUrl
from cppython.core.schema import CPPythonModel
class VcpkgDependency(CPPythonModel):
"""Vcpkg dependency type"""
name: Annotated[str, Field(description='The name of the dependency.')]
default_features: Annotated[
bool,
Field(
alias='default-features',
description='Whether to use the default features of the dependency. Defaults to true.',
),
] = True
features: Annotated[
list[str],
Field(description='A list of additional features to require for the dependency.'),
] = []
version_ge: Annotated[
str | None,
Field(
alias='version>=',
description='The minimum required version of the dependency, optionally with a port-version suffix.',
),
] = None
platform: Annotated[
str | None,
Field(description='A platform expression specifying the platforms where the dependency applies.'),
] = None
host: Annotated[
bool,
Field(description='Whether the dependency is required for the host machine instead of the target.'),
] = False
class VcpkgData(CPPythonModel):
"""Resolved vcpkg data"""
install_directory: Path
dependencies: list[VcpkgDependency]
builtin_baseline: str | None
class VcpkgConfiguration(CPPythonModel):
"""vcpkg provider configuration"""
install_directory: Annotated[
Path,
Field(
alias='install-directory',
description='The directory where vcpkg artifacts will be installed.',
),
] = Path('build')
builtin_baseline: Annotated[
str | None,
Field(
alias='builtin-baseline',
description='A shortcut for specifying the baseline for version resolution in the default registry.',
),
] = None
class Manifest(CPPythonModel):
"""The manifest schema"""
name: Annotated[str, Field(description='The project name')]
version_string: Annotated[str, Field(alias='version-string', description='The arbitrary version string')]
description: Annotated[str, Field(description='The project description')] = ''
homepage: Annotated[HttpUrl | None, Field(description='Homepage URL')] = None
dependencies: Annotated[list[VcpkgDependency], Field(description='List of dependencies')] = []
builtin_baseline: Annotated[str, Field(alias='builtin-baseline', description='The arbitrary version string')]