yamloom 0.1.0__cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.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.
- yamloom/__init__.py +4 -0
- yamloom/__init__.pyi +4 -0
- yamloom/__main__.py +58 -0
- yamloom/_yamloom.cpython-314t-s390x-linux-gnu.so +0 -0
- yamloom/_yamloom.pyi +584 -0
- yamloom/actions/__init__.py +0 -0
- yamloom/actions/github/__init__.py +0 -0
- yamloom/actions/github/artifacts.py +237 -0
- yamloom/actions/github/cache.py +189 -0
- yamloom/actions/github/release.py +97 -0
- yamloom/actions/github/scm.py +102 -0
- yamloom/actions/packaging/__init__.py +0 -0
- yamloom/actions/packaging/python.py +84 -0
- yamloom/actions/toolchains/__init__.py +0 -0
- yamloom/actions/toolchains/dotnet.py +79 -0
- yamloom/actions/toolchains/go.py +71 -0
- yamloom/actions/toolchains/java.py +98 -0
- yamloom/actions/toolchains/node.py +138 -0
- yamloom/actions/toolchains/php.py +76 -0
- yamloom/actions/toolchains/python.py +194 -0
- yamloom/actions/toolchains/ruby.py +78 -0
- yamloom/actions/toolchains/rust.py +153 -0
- yamloom/actions/toolchains/system.py +72 -0
- yamloom/actions/types.py +30 -0
- yamloom/actions/utils.py +32 -0
- yamloom/expressions.py +5 -0
- yamloom/expressions.pyi +360 -0
- yamloom/py.typed +0 -0
- yamloom-0.1.0.dist-info/METADATA +7 -0
- yamloom-0.1.0.dist-info/RECORD +31 -0
- yamloom-0.1.0.dist-info/WHEEL +5 -0
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Sequence
|
|
3
|
+
from yamloom.actions.utils import validate_choice
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from ..._yamloom import Step
|
|
8
|
+
from ..._yamloom import action
|
|
9
|
+
from ..types import (
|
|
10
|
+
Oboollike,
|
|
11
|
+
Oboolstr,
|
|
12
|
+
Ointlike,
|
|
13
|
+
Ostr,
|
|
14
|
+
Ostrlike,
|
|
15
|
+
StringLike,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from collections.abc import Mapping
|
|
20
|
+
|
|
21
|
+
__all__ = ['setup_dotnet']
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def setup_dotnet(
|
|
25
|
+
*,
|
|
26
|
+
name: Ostrlike = None,
|
|
27
|
+
version: str = 'v5',
|
|
28
|
+
dotnet_version: Ostrlike = None,
|
|
29
|
+
dotnet_quality: Ostrlike = None,
|
|
30
|
+
global_json_file: Ostrlike = None,
|
|
31
|
+
source_url: Ostrlike = None,
|
|
32
|
+
owner: Ostrlike = None,
|
|
33
|
+
config_file: Ostrlike = None,
|
|
34
|
+
cache: Oboollike = None,
|
|
35
|
+
cache_dependency_path: Ostrlike | Sequence[StringLike] = None,
|
|
36
|
+
args: Ostrlike = None,
|
|
37
|
+
entrypoint: Ostrlike = None,
|
|
38
|
+
condition: Oboolstr = None,
|
|
39
|
+
working_directory: Ostrlike = None,
|
|
40
|
+
shell: Ostr = None,
|
|
41
|
+
id: Ostr = None, # noqa: A002
|
|
42
|
+
env: Mapping[str, StringLike] | None = None,
|
|
43
|
+
continue_on_error: Oboollike = None,
|
|
44
|
+
timeout_minutes: Ointlike = None,
|
|
45
|
+
) -> Step:
|
|
46
|
+
options: dict[str, object] = {
|
|
47
|
+
'dotnet-version': dotnet_version,
|
|
48
|
+
'dotnet-quality': validate_choice(
|
|
49
|
+
'dotnet-quality',
|
|
50
|
+
dotnet_quality,
|
|
51
|
+
['daily', 'signed', 'validated', 'preview', 'ga'],
|
|
52
|
+
),
|
|
53
|
+
'global-json-file': global_json_file,
|
|
54
|
+
'source-url': source_url,
|
|
55
|
+
'owner': owner,
|
|
56
|
+
'config-file': config_file,
|
|
57
|
+
'cache': cache,
|
|
58
|
+
'cache-dependency-path': cache_dependency_path,
|
|
59
|
+
}
|
|
60
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
61
|
+
|
|
62
|
+
if name is None:
|
|
63
|
+
name = 'Setup .NET'
|
|
64
|
+
|
|
65
|
+
return action(
|
|
66
|
+
name,
|
|
67
|
+
'actions/setup-dotnet',
|
|
68
|
+
ref=version,
|
|
69
|
+
with_opts=options or None,
|
|
70
|
+
args=args,
|
|
71
|
+
entrypoint=entrypoint,
|
|
72
|
+
condition=condition,
|
|
73
|
+
working_directory=working_directory,
|
|
74
|
+
shell=shell,
|
|
75
|
+
id=id,
|
|
76
|
+
env=env,
|
|
77
|
+
continue_on_error=continue_on_error,
|
|
78
|
+
timeout_minutes=timeout_minutes,
|
|
79
|
+
)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from ..._yamloom import Step
|
|
6
|
+
from ..._yamloom import action
|
|
7
|
+
from ..types import (
|
|
8
|
+
Oboollike,
|
|
9
|
+
Oboolstr,
|
|
10
|
+
Ointlike,
|
|
11
|
+
Ostr,
|
|
12
|
+
Ostrlike,
|
|
13
|
+
StringLike,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from collections.abc import Mapping
|
|
18
|
+
|
|
19
|
+
__all__ = ['setup_go']
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def setup_go(
|
|
23
|
+
*,
|
|
24
|
+
name: Ostrlike = None,
|
|
25
|
+
version: str = 'v6',
|
|
26
|
+
go_version: Ostrlike = None,
|
|
27
|
+
go_version_file: Ostrlike = None,
|
|
28
|
+
check_latest: Oboollike = None,
|
|
29
|
+
architecture: Ostrlike = None,
|
|
30
|
+
token: Ostrlike = None,
|
|
31
|
+
cache: Oboollike = None,
|
|
32
|
+
cache_dependency_path: Ostrlike = None,
|
|
33
|
+
args: Ostrlike = None,
|
|
34
|
+
entrypoint: Ostrlike = None,
|
|
35
|
+
condition: Oboolstr = None,
|
|
36
|
+
working_directory: Ostrlike = None,
|
|
37
|
+
shell: Ostr = None,
|
|
38
|
+
id: Ostr = None, # noqa: A002
|
|
39
|
+
env: Mapping[str, StringLike] | None = None,
|
|
40
|
+
continue_on_error: Oboollike = None,
|
|
41
|
+
timeout_minutes: Ointlike = None,
|
|
42
|
+
) -> Step:
|
|
43
|
+
options: dict[str, object] = {
|
|
44
|
+
'go-version': go_version,
|
|
45
|
+
'go-version-file': go_version_file,
|
|
46
|
+
'check-latest': check_latest,
|
|
47
|
+
'architecture': architecture,
|
|
48
|
+
'token': token,
|
|
49
|
+
'cache': cache,
|
|
50
|
+
'cache-dependency-path': cache_dependency_path,
|
|
51
|
+
}
|
|
52
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
53
|
+
|
|
54
|
+
if name is None:
|
|
55
|
+
name = 'Setup Go'
|
|
56
|
+
|
|
57
|
+
return action(
|
|
58
|
+
name,
|
|
59
|
+
'actions/setup-go',
|
|
60
|
+
ref=version,
|
|
61
|
+
with_opts=options or None,
|
|
62
|
+
args=args,
|
|
63
|
+
entrypoint=entrypoint,
|
|
64
|
+
condition=condition,
|
|
65
|
+
working_directory=working_directory,
|
|
66
|
+
shell=shell,
|
|
67
|
+
id=id,
|
|
68
|
+
env=env,
|
|
69
|
+
continue_on_error=continue_on_error,
|
|
70
|
+
timeout_minutes=timeout_minutes,
|
|
71
|
+
)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import validate_choice
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Ointlike,
|
|
12
|
+
Ostr,
|
|
13
|
+
Ostrlike,
|
|
14
|
+
StringLike,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from collections.abc import Mapping
|
|
19
|
+
|
|
20
|
+
__all__ = ['setup_java']
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def setup_java(
|
|
24
|
+
*,
|
|
25
|
+
name: Ostrlike = None,
|
|
26
|
+
version: str = 'v5',
|
|
27
|
+
java_version: Ostrlike = None,
|
|
28
|
+
java_version_file: Ostrlike = None,
|
|
29
|
+
distribution: Ostrlike = None,
|
|
30
|
+
java_package: Ostrlike = None,
|
|
31
|
+
check_latest: Oboollike = None,
|
|
32
|
+
architecture: Ostrlike = None,
|
|
33
|
+
jdk_file: Ostrlike = None,
|
|
34
|
+
cache: Ostrlike = None,
|
|
35
|
+
cache_dependency_path: Ostrlike = None,
|
|
36
|
+
overwrite_settings: Oboollike = None,
|
|
37
|
+
server_id: Ostrlike = None,
|
|
38
|
+
server_username: Ostrlike = None,
|
|
39
|
+
server_password: Ostrlike = None,
|
|
40
|
+
settings_path: Ostrlike = None,
|
|
41
|
+
gpg_private_key: Ostrlike = None,
|
|
42
|
+
gpg_passphrase: Ostrlike = None,
|
|
43
|
+
mvn_toolchain_id: Ostrlike = None,
|
|
44
|
+
mvn_toolchain_vendor: Ostrlike = None,
|
|
45
|
+
args: Ostrlike = None,
|
|
46
|
+
entrypoint: Ostrlike = None,
|
|
47
|
+
condition: Oboolstr = None,
|
|
48
|
+
working_directory: Ostrlike = None,
|
|
49
|
+
shell: Ostr = None,
|
|
50
|
+
id: Ostr = None, # noqa: A002
|
|
51
|
+
env: Mapping[str, StringLike] | None = None,
|
|
52
|
+
continue_on_error: Oboollike = None,
|
|
53
|
+
timeout_minutes: Ointlike = None,
|
|
54
|
+
) -> Step:
|
|
55
|
+
options: dict[str, object] = {
|
|
56
|
+
'java-version': java_version,
|
|
57
|
+
'java-version-file': java_version_file,
|
|
58
|
+
'distribution': distribution,
|
|
59
|
+
'java-package': validate_choice(
|
|
60
|
+
'java_package', java_package, ['jdk', 'jre', 'jdk+fx', 'jre+fx']
|
|
61
|
+
),
|
|
62
|
+
'check-latest': check_latest,
|
|
63
|
+
'architecture': validate_choice(
|
|
64
|
+
'architecture', architecture, ['x86', 'x64', 'armv7', 'aarch64', 'ppc64le']
|
|
65
|
+
),
|
|
66
|
+
'jdkFile': jdk_file,
|
|
67
|
+
'cache': validate_choice('cache', cache, ['maven', 'gradle', 'sbt']),
|
|
68
|
+
'cache-dependency-path': cache_dependency_path,
|
|
69
|
+
'overwrite-settings': overwrite_settings,
|
|
70
|
+
'server-id': server_id,
|
|
71
|
+
'server-username': server_username,
|
|
72
|
+
'server-password': server_password,
|
|
73
|
+
'settings-path': settings_path,
|
|
74
|
+
'gpg-private_key': gpg_private_key,
|
|
75
|
+
'gpg-passphrase': gpg_passphrase,
|
|
76
|
+
'mvn-toolchain-id': mvn_toolchain_id,
|
|
77
|
+
'mvn-toolchain-vendor': mvn_toolchain_vendor,
|
|
78
|
+
}
|
|
79
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
80
|
+
|
|
81
|
+
if name is None:
|
|
82
|
+
name = 'Setup Java'
|
|
83
|
+
|
|
84
|
+
return action(
|
|
85
|
+
name,
|
|
86
|
+
'actions/setup-java',
|
|
87
|
+
ref=version,
|
|
88
|
+
with_opts=options or None,
|
|
89
|
+
args=args,
|
|
90
|
+
entrypoint=entrypoint,
|
|
91
|
+
condition=condition,
|
|
92
|
+
working_directory=working_directory,
|
|
93
|
+
shell=shell,
|
|
94
|
+
id=id,
|
|
95
|
+
env=env,
|
|
96
|
+
continue_on_error=continue_on_error,
|
|
97
|
+
timeout_minutes=timeout_minutes,
|
|
98
|
+
)
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Sequence
|
|
3
|
+
from yamloom.actions.utils import validate_choice
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from ..._yamloom import Step
|
|
8
|
+
from ..._yamloom import action
|
|
9
|
+
from ..types import (
|
|
10
|
+
Oboollike,
|
|
11
|
+
Oboolstr,
|
|
12
|
+
Ointlike,
|
|
13
|
+
Ostr,
|
|
14
|
+
Ostrlike,
|
|
15
|
+
StringLike,
|
|
16
|
+
BoolLike,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from collections.abc import Mapping
|
|
21
|
+
|
|
22
|
+
__all__ = ['setup_node', 'setup_pnpm']
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def setup_node(
|
|
26
|
+
*,
|
|
27
|
+
name: Ostrlike = None,
|
|
28
|
+
version: str = 'v6',
|
|
29
|
+
node_version: Ostrlike = None,
|
|
30
|
+
node_version_file: Ostrlike = None,
|
|
31
|
+
check_latest: Oboollike = None,
|
|
32
|
+
architecture: Ostrlike = None,
|
|
33
|
+
token: Ostrlike = None,
|
|
34
|
+
cache: Ostrlike = None,
|
|
35
|
+
package_manager_cache: Oboollike = None,
|
|
36
|
+
cache_dependency_path: Ostrlike = None,
|
|
37
|
+
registry_url: Ostrlike = None,
|
|
38
|
+
scope: Ostrlike = None,
|
|
39
|
+
mirror: Ostrlike = None,
|
|
40
|
+
mirror_token: Ostrlike = None,
|
|
41
|
+
args: Ostrlike = None,
|
|
42
|
+
entrypoint: Ostrlike = None,
|
|
43
|
+
condition: Oboolstr = None,
|
|
44
|
+
working_directory: Ostrlike = None,
|
|
45
|
+
shell: Ostr = None,
|
|
46
|
+
id: Ostr = None, # noqa: A002
|
|
47
|
+
env: Mapping[str, StringLike] | None = None,
|
|
48
|
+
continue_on_error: Oboollike = None,
|
|
49
|
+
timeout_minutes: Ointlike = None,
|
|
50
|
+
) -> Step:
|
|
51
|
+
options: dict[str, object] = {
|
|
52
|
+
'node-version': node_version,
|
|
53
|
+
'node-version-file': node_version_file,
|
|
54
|
+
'check-latest': check_latest,
|
|
55
|
+
'architecture': architecture,
|
|
56
|
+
'token': token,
|
|
57
|
+
'cache': validate_choice('cache', cache, ['npm', 'yarn', 'pnpm']),
|
|
58
|
+
'package-manager-cache': package_manager_cache,
|
|
59
|
+
'cache-dependency-path': cache_dependency_path,
|
|
60
|
+
'registry-url': registry_url,
|
|
61
|
+
'scope': scope,
|
|
62
|
+
'mirror': mirror,
|
|
63
|
+
'mirror-token': mirror_token,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
67
|
+
|
|
68
|
+
if name is None:
|
|
69
|
+
name = 'Setup Node'
|
|
70
|
+
|
|
71
|
+
return action(
|
|
72
|
+
name,
|
|
73
|
+
'actions/setup-node',
|
|
74
|
+
ref=version,
|
|
75
|
+
with_opts=options or None,
|
|
76
|
+
args=args,
|
|
77
|
+
entrypoint=entrypoint,
|
|
78
|
+
condition=condition,
|
|
79
|
+
working_directory=working_directory,
|
|
80
|
+
shell=shell,
|
|
81
|
+
id=id,
|
|
82
|
+
env=env,
|
|
83
|
+
continue_on_error=continue_on_error,
|
|
84
|
+
timeout_minutes=timeout_minutes,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def setup_pnpm(
|
|
89
|
+
*,
|
|
90
|
+
name: Ostrlike = None,
|
|
91
|
+
version: str = 'v4',
|
|
92
|
+
pnpm_version: Ostrlike = None,
|
|
93
|
+
dest: Ostrlike = None,
|
|
94
|
+
run_install: StringLike | BoolLike | None = None,
|
|
95
|
+
cache: Oboollike = None,
|
|
96
|
+
cache_dependency_path: Ostrlike | Sequence[StringLike] = None,
|
|
97
|
+
package_json_file: Ostrlike = None,
|
|
98
|
+
standalone: Oboollike = None,
|
|
99
|
+
args: Ostrlike = None,
|
|
100
|
+
entrypoint: Ostrlike = None,
|
|
101
|
+
condition: Oboolstr = None,
|
|
102
|
+
working_directory: Ostrlike = None,
|
|
103
|
+
shell: Ostr = None,
|
|
104
|
+
id: Ostr = None, # noqa: A002
|
|
105
|
+
env: Mapping[str, StringLike] | None = None,
|
|
106
|
+
continue_on_error: Oboollike = None,
|
|
107
|
+
timeout_minutes: Ointlike = None,
|
|
108
|
+
) -> Step:
|
|
109
|
+
options: dict[str, object] = {
|
|
110
|
+
'version': pnpm_version,
|
|
111
|
+
'dest': dest,
|
|
112
|
+
'run_install': run_install,
|
|
113
|
+
'cache': cache,
|
|
114
|
+
'cache_dependency_path': cache_dependency_path,
|
|
115
|
+
'package_json_file': package_json_file,
|
|
116
|
+
'standalone': standalone,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
120
|
+
|
|
121
|
+
if name is None:
|
|
122
|
+
name = 'Setup pnpm'
|
|
123
|
+
|
|
124
|
+
return action(
|
|
125
|
+
name,
|
|
126
|
+
'pnpm/action-setup',
|
|
127
|
+
ref=version,
|
|
128
|
+
with_opts=options or None,
|
|
129
|
+
args=args,
|
|
130
|
+
entrypoint=entrypoint,
|
|
131
|
+
condition=condition,
|
|
132
|
+
working_directory=working_directory,
|
|
133
|
+
shell=shell,
|
|
134
|
+
id=id,
|
|
135
|
+
env=env,
|
|
136
|
+
continue_on_error=continue_on_error,
|
|
137
|
+
timeout_minutes=timeout_minutes,
|
|
138
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import validate_choice
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Ointlike,
|
|
12
|
+
Ostr,
|
|
13
|
+
Ostrlike,
|
|
14
|
+
StringLike,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from collections.abc import Mapping
|
|
19
|
+
|
|
20
|
+
__all__ = ['setup_php']
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def setup_php(
|
|
24
|
+
*,
|
|
25
|
+
name: Ostrlike = None,
|
|
26
|
+
version: str = 'v2',
|
|
27
|
+
php_version: Ostrlike = None,
|
|
28
|
+
php_version_file: Ostrlike = None,
|
|
29
|
+
extensions: Ostrlike = None,
|
|
30
|
+
ini_file: Ostrlike = None,
|
|
31
|
+
ini_values: Ostrlike = None,
|
|
32
|
+
coverage: Ostrlike = None,
|
|
33
|
+
tools: Ostrlike = None,
|
|
34
|
+
github_token: Ostrlike = None,
|
|
35
|
+
args: Ostrlike = None,
|
|
36
|
+
entrypoint: Ostrlike = None,
|
|
37
|
+
condition: Oboolstr = None,
|
|
38
|
+
working_directory: Ostrlike = None,
|
|
39
|
+
shell: Ostr = None,
|
|
40
|
+
id: Ostr = None, # noqa: A002
|
|
41
|
+
env: Mapping[str, StringLike] | None = None,
|
|
42
|
+
continue_on_error: Oboollike = None,
|
|
43
|
+
timeout_minutes: Ointlike = None,
|
|
44
|
+
) -> Step:
|
|
45
|
+
options: dict[str, object] = {
|
|
46
|
+
'php-version': php_version,
|
|
47
|
+
'php-version-file': php_version_file,
|
|
48
|
+
'extensions': extensions,
|
|
49
|
+
'ini-file': validate_choice(
|
|
50
|
+
'ini_file', ini_file, ['production', 'development', 'none']
|
|
51
|
+
),
|
|
52
|
+
'ini-values': ini_values,
|
|
53
|
+
'coverage': validate_choice('coverage', coverage, ['xdebug', 'pcov', 'none']),
|
|
54
|
+
'tools': tools,
|
|
55
|
+
'github-token': github_token,
|
|
56
|
+
}
|
|
57
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
58
|
+
|
|
59
|
+
if name is None:
|
|
60
|
+
name = 'Setup PHP'
|
|
61
|
+
|
|
62
|
+
return action(
|
|
63
|
+
name,
|
|
64
|
+
'shivammathur/setup-php',
|
|
65
|
+
ref=version,
|
|
66
|
+
with_opts=options or None,
|
|
67
|
+
args=args,
|
|
68
|
+
entrypoint=entrypoint,
|
|
69
|
+
condition=condition,
|
|
70
|
+
working_directory=working_directory,
|
|
71
|
+
shell=shell,
|
|
72
|
+
id=id,
|
|
73
|
+
env=env,
|
|
74
|
+
continue_on_error=continue_on_error,
|
|
75
|
+
timeout_minutes=timeout_minutes,
|
|
76
|
+
)
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from yamloom.actions.utils import validate_choice
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..._yamloom import Step
|
|
7
|
+
from ..._yamloom import action
|
|
8
|
+
from ..types import (
|
|
9
|
+
Oboollike,
|
|
10
|
+
Oboolstr,
|
|
11
|
+
Ointlike,
|
|
12
|
+
Ostr,
|
|
13
|
+
Ostrlike,
|
|
14
|
+
StringLike,
|
|
15
|
+
StringOrBoolLike,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from collections.abc import Mapping, Sequence
|
|
20
|
+
|
|
21
|
+
__all__ = ['setup_python', 'setup_uv']
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def setup_python(
|
|
25
|
+
*,
|
|
26
|
+
name: Ostrlike = None,
|
|
27
|
+
version: str = 'v6',
|
|
28
|
+
python_version: StringLike | None = None,
|
|
29
|
+
python_version_file: Ostrlike = None,
|
|
30
|
+
check_latest: Oboollike = None,
|
|
31
|
+
architecture: Ostrlike = None,
|
|
32
|
+
token: Ostrlike = None,
|
|
33
|
+
cache: Ostrlike = None,
|
|
34
|
+
package_manager_cache: Oboollike = None,
|
|
35
|
+
cache_dependency_path: Ostrlike = None,
|
|
36
|
+
update_environment: Oboollike = None,
|
|
37
|
+
allow_prereleases: Oboollike = None,
|
|
38
|
+
freethreaded: Oboollike = None,
|
|
39
|
+
pip_versions: Ostrlike = None,
|
|
40
|
+
pip_install: Ostrlike = None,
|
|
41
|
+
args: Ostrlike = None,
|
|
42
|
+
entrypoint: Ostrlike = None,
|
|
43
|
+
condition: Oboolstr = None,
|
|
44
|
+
working_directory: Ostrlike = None,
|
|
45
|
+
shell: Ostr = None,
|
|
46
|
+
id: Ostr = None, # noqa: A002
|
|
47
|
+
env: Mapping[str, StringLike] | None = None,
|
|
48
|
+
continue_on_error: Oboollike = None,
|
|
49
|
+
timeout_minutes: Ointlike = None,
|
|
50
|
+
) -> Step:
|
|
51
|
+
options: dict[str, object] = {
|
|
52
|
+
'python-version': python_version,
|
|
53
|
+
'python-version-file': python_version_file,
|
|
54
|
+
'check-latest': check_latest,
|
|
55
|
+
'architecture': architecture,
|
|
56
|
+
'token': token,
|
|
57
|
+
'cache': cache,
|
|
58
|
+
'package-manager-cache': package_manager_cache,
|
|
59
|
+
'cache-dependency-path': cache_dependency_path,
|
|
60
|
+
'update-environment': update_environment,
|
|
61
|
+
'allow-prereleases': allow_prereleases,
|
|
62
|
+
'freethreaded': freethreaded,
|
|
63
|
+
'pip-versions': pip_versions,
|
|
64
|
+
'pip-install': pip_install,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if cache is not None:
|
|
68
|
+
if isinstance(cache, str):
|
|
69
|
+
lowered = cache.lower()
|
|
70
|
+
if lowered not in {'pip', 'pipenv', 'poetry'}:
|
|
71
|
+
msg = "'cache' must be 'pip', 'pipenv' or 'poetry'"
|
|
72
|
+
raise ValueError(msg)
|
|
73
|
+
options['cache'] = lowered
|
|
74
|
+
else:
|
|
75
|
+
options['cache'] = cache
|
|
76
|
+
|
|
77
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
78
|
+
|
|
79
|
+
if name is None:
|
|
80
|
+
name = 'Setup Python'
|
|
81
|
+
|
|
82
|
+
return action(
|
|
83
|
+
name,
|
|
84
|
+
'actions/setup-python',
|
|
85
|
+
ref=version,
|
|
86
|
+
with_opts=options or None,
|
|
87
|
+
args=args,
|
|
88
|
+
entrypoint=entrypoint,
|
|
89
|
+
condition=condition,
|
|
90
|
+
working_directory=working_directory,
|
|
91
|
+
shell=shell,
|
|
92
|
+
id=id,
|
|
93
|
+
env=env,
|
|
94
|
+
continue_on_error=continue_on_error,
|
|
95
|
+
timeout_minutes=timeout_minutes,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def setup_uv(
|
|
100
|
+
*,
|
|
101
|
+
name: Ostrlike = None,
|
|
102
|
+
version: str = 'v7',
|
|
103
|
+
uv_version: Ostrlike = None,
|
|
104
|
+
uv_version_file: Ostrlike = None,
|
|
105
|
+
resolution_strategy: Ostrlike = None,
|
|
106
|
+
python_version: Ostrlike = None,
|
|
107
|
+
activate_environment: Oboollike = None,
|
|
108
|
+
uv_working_directory: Ostrlike = None,
|
|
109
|
+
checksum: Ostrlike = None,
|
|
110
|
+
github_token: Ostrlike = None,
|
|
111
|
+
enable_cache: StringOrBoolLike | None = None,
|
|
112
|
+
cache_dependency_glob: Sequence[StringLike] | None = None,
|
|
113
|
+
restore_cache: Oboollike = None,
|
|
114
|
+
save_cache: Oboollike = None,
|
|
115
|
+
cache_suffix: Ostrlike = None,
|
|
116
|
+
cache_local_path: Ostrlike = None,
|
|
117
|
+
prune_cache: Oboollike = None,
|
|
118
|
+
cache_python: Oboollike = None,
|
|
119
|
+
ignore_nothing_to_cache: Oboollike = None,
|
|
120
|
+
ignore_empty_workdir: Oboollike = None,
|
|
121
|
+
tool_dir: Ostrlike = None,
|
|
122
|
+
tool_bin_dir: Ostrlike = None,
|
|
123
|
+
manifest_file: Ostrlike = None,
|
|
124
|
+
add_problem_matchers: Oboollike = None,
|
|
125
|
+
args: Ostrlike = None,
|
|
126
|
+
entrypoint: Ostrlike = None,
|
|
127
|
+
condition: Oboolstr = None,
|
|
128
|
+
working_directory: Ostrlike = None,
|
|
129
|
+
shell: Ostr = None,
|
|
130
|
+
id: Ostr = None, # noqa: A002
|
|
131
|
+
env: Mapping[str, StringLike] | None = None,
|
|
132
|
+
continue_on_error: Oboollike = None,
|
|
133
|
+
timeout_minutes: Ointlike = None,
|
|
134
|
+
) -> Step:
|
|
135
|
+
options: dict[str, object] = {
|
|
136
|
+
'version': uv_version,
|
|
137
|
+
'version-file': uv_version_file,
|
|
138
|
+
'resolution-strategy': validate_choice(
|
|
139
|
+
'resolution_strategy', resolution_strategy, ['highest', 'lowest']
|
|
140
|
+
),
|
|
141
|
+
'python-version': python_version,
|
|
142
|
+
'activate-environment': activate_environment,
|
|
143
|
+
'working-directory': uv_working_directory,
|
|
144
|
+
'checksum': checksum,
|
|
145
|
+
'github-token': github_token,
|
|
146
|
+
'enable-cache': enable_cache,
|
|
147
|
+
'cache-dependency-glob': '\n'.join(str(s) for s in cache_dependency_glob)
|
|
148
|
+
if cache_dependency_glob is not None
|
|
149
|
+
else None,
|
|
150
|
+
'restore-cache': restore_cache,
|
|
151
|
+
'save-cache': save_cache,
|
|
152
|
+
'cache-suffix': cache_suffix,
|
|
153
|
+
'cache-local-path': cache_local_path,
|
|
154
|
+
'prune-cache': prune_cache,
|
|
155
|
+
'cache-python': cache_python,
|
|
156
|
+
'ignore-nothing-to-cache': ignore_nothing_to_cache,
|
|
157
|
+
'ignore-empty-workdir': ignore_empty_workdir,
|
|
158
|
+
'tool-dir': tool_dir,
|
|
159
|
+
'tool-bin-dir': tool_bin_dir,
|
|
160
|
+
'manifest-file': manifest_file,
|
|
161
|
+
'add-problem-matchers': add_problem_matchers,
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if enable_cache is not None:
|
|
165
|
+
if isinstance(enable_cache, str):
|
|
166
|
+
if enable_cache.lower() != 'auto':
|
|
167
|
+
msg = "'enable_cache' must be 'auto', true or false"
|
|
168
|
+
raise ValueError(msg)
|
|
169
|
+
options['enable-cache'] = 'auto'
|
|
170
|
+
elif isinstance(enable_cache, bool):
|
|
171
|
+
options['enable-cache'] = enable_cache
|
|
172
|
+
else:
|
|
173
|
+
options['enable-cache'] = enable_cache
|
|
174
|
+
|
|
175
|
+
options = {key: value for key, value in options.items() if value is not None}
|
|
176
|
+
|
|
177
|
+
if name is None:
|
|
178
|
+
name = 'Setup uv'
|
|
179
|
+
|
|
180
|
+
return action(
|
|
181
|
+
name,
|
|
182
|
+
'astral-sh/setup-uv',
|
|
183
|
+
ref=version,
|
|
184
|
+
with_opts=options or None,
|
|
185
|
+
args=args,
|
|
186
|
+
entrypoint=entrypoint,
|
|
187
|
+
condition=condition,
|
|
188
|
+
working_directory=working_directory,
|
|
189
|
+
shell=shell,
|
|
190
|
+
id=id,
|
|
191
|
+
env=env,
|
|
192
|
+
continue_on_error=continue_on_error,
|
|
193
|
+
timeout_minutes=timeout_minutes,
|
|
194
|
+
)
|