dycw-actions 0.3.2__py3-none-any.whl → 0.7.1__py3-none-any.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.
- actions/__init__.py +1 -1
- actions/action_dicts/constants.py +8 -0
- actions/action_dicts/lib.py +186 -0
- actions/clean_dir/cli.py +21 -0
- actions/clean_dir/constants.py +7 -0
- actions/clean_dir/lib.py +59 -0
- actions/clean_dir/settings.py +18 -0
- actions/cli.py +95 -6
- actions/constants.py +10 -0
- actions/pre_commit/click.py +15 -0
- actions/pre_commit/conformalize_repo/__init__.py +1 -0
- actions/pre_commit/conformalize_repo/cli.py +64 -0
- actions/pre_commit/conformalize_repo/configs/gitignore +244 -0
- actions/pre_commit/conformalize_repo/constants.py +78 -0
- actions/pre_commit/conformalize_repo/lib.py +1293 -0
- actions/pre_commit/conformalize_repo/settings.py +119 -0
- actions/pre_commit/constants.py +8 -0
- actions/pre_commit/format_requirements/__init__.py +1 -0
- actions/pre_commit/format_requirements/cli.py +24 -0
- actions/pre_commit/format_requirements/constants.py +7 -0
- actions/pre_commit/format_requirements/lib.py +52 -0
- actions/pre_commit/replace_sequence_strs/__init__.py +1 -0
- actions/pre_commit/replace_sequence_strs/cli.py +24 -0
- actions/pre_commit/replace_sequence_strs/constants.py +7 -0
- actions/pre_commit/replace_sequence_strs/lib.py +73 -0
- actions/pre_commit/touch_empty_py/__init__.py +1 -0
- actions/pre_commit/touch_empty_py/cli.py +24 -0
- actions/pre_commit/touch_empty_py/constants.py +7 -0
- actions/pre_commit/touch_empty_py/lib.py +54 -0
- actions/pre_commit/touch_py_typed/__init__.py +1 -0
- actions/pre_commit/touch_py_typed/cli.py +24 -0
- actions/pre_commit/touch_py_typed/constants.py +7 -0
- actions/pre_commit/touch_py_typed/lib.py +64 -0
- actions/pre_commit/update_requirements/__init__.py +1 -0
- actions/pre_commit/update_requirements/classes.py +117 -0
- actions/pre_commit/update_requirements/cli.py +24 -0
- actions/pre_commit/update_requirements/constants.py +7 -0
- actions/pre_commit/update_requirements/lib.py +128 -0
- actions/pre_commit/utilities.py +386 -0
- actions/publish_package/__init__.py +1 -0
- actions/publish_package/cli.py +27 -0
- actions/publish_package/constants.py +7 -0
- actions/{publish → publish_package}/lib.py +18 -17
- actions/{publish → publish_package}/settings.py +7 -7
- actions/py.typed +0 -0
- actions/random_sleep/__init__.py +1 -0
- actions/random_sleep/cli.py +26 -0
- actions/random_sleep/constants.py +7 -0
- actions/{sleep → random_sleep}/lib.py +14 -13
- actions/{sleep → random_sleep}/settings.py +3 -3
- actions/run_hooks/__init__.py +1 -0
- actions/run_hooks/cli.py +21 -0
- actions/run_hooks/constants.py +7 -0
- actions/run_hooks/lib.py +97 -0
- actions/run_hooks/settings.py +24 -0
- actions/setup_cronjob/__init__.py +1 -0
- actions/setup_cronjob/cli.py +31 -0
- actions/setup_cronjob/configs/cron.tmpl +3 -0
- actions/setup_cronjob/configs/logrotate.tmpl +10 -0
- actions/setup_cronjob/constants.py +12 -0
- actions/setup_cronjob/lib.py +120 -0
- actions/setup_cronjob/settings.py +27 -0
- actions/tag_commit/__init__.py +1 -0
- actions/tag_commit/cli.py +27 -0
- actions/tag_commit/constants.py +7 -0
- actions/tag_commit/lib.py +63 -0
- actions/{tag → tag_commit}/settings.py +3 -3
- actions/types.py +14 -1
- actions/utilities.py +131 -17
- dycw_actions-0.7.1.dist-info/METADATA +22 -0
- dycw_actions-0.7.1.dist-info/RECORD +77 -0
- {dycw_actions-0.3.2.dist-info → dycw_actions-0.7.1.dist-info}/WHEEL +1 -1
- actions/publish/cli.py +0 -43
- actions/settings.py +0 -18
- actions/sleep/cli.py +0 -39
- actions/tag/cli.py +0 -43
- actions/tag/lib.py +0 -62
- dycw_actions-0.3.2.dist-info/METADATA +0 -14
- dycw_actions-0.3.2.dist-info/RECORD +0 -22
- /actions/{publish → action_dicts}/__init__.py +0 -0
- /actions/{sleep → clean_dir}/__init__.py +0 -0
- /actions/{tag → pre_commit}/__init__.py +0 -0
- {dycw_actions-0.3.2.dist-info → dycw_actions-0.7.1.dist-info}/entry_points.txt +0 -0
actions/utilities.py
CHANGED
|
@@ -1,50 +1,164 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from io import StringIO
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Literal, assert_never, overload
|
|
4
6
|
|
|
5
|
-
from typed_settings import EnvLoader
|
|
7
|
+
from typed_settings import EnvLoader, Secret
|
|
8
|
+
from utilities.atomicwrites import writer
|
|
6
9
|
from utilities.subprocess import run
|
|
7
10
|
|
|
11
|
+
from actions.constants import YAML_INSTANCE
|
|
8
12
|
from actions.logging import LOGGER
|
|
9
13
|
|
|
10
14
|
if TYPE_CHECKING:
|
|
15
|
+
from collections.abc import MutableSet
|
|
16
|
+
|
|
17
|
+
from utilities.types import PathLike, StrStrMapping
|
|
18
|
+
|
|
11
19
|
from actions.types import SecretLike
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
LOADER = EnvLoader("")
|
|
15
23
|
|
|
16
24
|
|
|
17
|
-
def
|
|
18
|
-
return
|
|
25
|
+
def are_equal_modulo_new_line(x: str, y: str, /) -> bool:
|
|
26
|
+
return ensure_new_line(x) == ensure_new_line(y)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def convert_list_strs(
|
|
30
|
+
x: str | list[str] | tuple[str, ...] | None, /
|
|
31
|
+
) -> list[str] | None:
|
|
32
|
+
match x:
|
|
33
|
+
case None:
|
|
34
|
+
return None
|
|
35
|
+
case list():
|
|
36
|
+
return x
|
|
37
|
+
case tuple():
|
|
38
|
+
return None if x == () else list(x)
|
|
39
|
+
case str():
|
|
40
|
+
return x.splitlines()
|
|
41
|
+
case never:
|
|
42
|
+
assert_never(never)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def convert_secret_str(x: SecretLike | None, /) -> Secret[str] | None:
|
|
46
|
+
match x:
|
|
47
|
+
case Secret():
|
|
48
|
+
match x.get_secret_value():
|
|
49
|
+
case None:
|
|
50
|
+
return None
|
|
51
|
+
case str() as inner:
|
|
52
|
+
return None if inner == "" else Secret(inner)
|
|
53
|
+
case never:
|
|
54
|
+
assert_never(never)
|
|
55
|
+
case str():
|
|
56
|
+
return None if x == "" else Secret(x)
|
|
57
|
+
case None:
|
|
58
|
+
return None
|
|
59
|
+
case never:
|
|
60
|
+
assert_never(never)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def convert_str(x: str | None, /) -> str | None:
|
|
64
|
+
match x:
|
|
65
|
+
case str():
|
|
66
|
+
return None if x == "" else x
|
|
67
|
+
case None:
|
|
68
|
+
return None
|
|
69
|
+
case never:
|
|
70
|
+
assert_never(never)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def copy_text(
|
|
74
|
+
src: PathLike, dest: PathLike, /, *, modifications: MutableSet[Path] | None = None
|
|
75
|
+
) -> None:
|
|
76
|
+
LOGGER.info("Copying '%s' -> '%s'...", str(src), str(dest))
|
|
77
|
+
text = Path(src).read_text()
|
|
78
|
+
write_text(dest, text, modifications=modifications)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def ensure_new_line(text: str, /) -> str:
|
|
82
|
+
return text.strip("\n") + "\n"
|
|
19
83
|
|
|
20
84
|
|
|
21
85
|
@overload
|
|
22
|
-
def
|
|
23
|
-
cmd: SecretLike,
|
|
86
|
+
def logged_run(
|
|
87
|
+
cmd: SecretLike,
|
|
88
|
+
/,
|
|
89
|
+
*cmds_or_args: SecretLike,
|
|
90
|
+
env: StrStrMapping | None = None,
|
|
91
|
+
print: bool = False,
|
|
92
|
+
return_: Literal[True],
|
|
24
93
|
) -> str: ...
|
|
25
94
|
@overload
|
|
26
|
-
def
|
|
95
|
+
def logged_run(
|
|
27
96
|
cmd: SecretLike,
|
|
28
97
|
/,
|
|
29
|
-
*
|
|
98
|
+
*cmds_or_args: SecretLike,
|
|
99
|
+
env: StrStrMapping | None = None,
|
|
30
100
|
print: bool = False,
|
|
31
101
|
return_: Literal[False] = False,
|
|
32
102
|
) -> None: ...
|
|
33
103
|
@overload
|
|
34
|
-
def
|
|
35
|
-
cmd: SecretLike,
|
|
104
|
+
def logged_run(
|
|
105
|
+
cmd: SecretLike,
|
|
106
|
+
/,
|
|
107
|
+
*cmds_or_args: SecretLike,
|
|
108
|
+
env: StrStrMapping | None = None,
|
|
109
|
+
print: bool = False,
|
|
110
|
+
return_: bool = False,
|
|
36
111
|
) -> str | None: ...
|
|
37
|
-
def
|
|
112
|
+
def logged_run(
|
|
38
113
|
cmd: SecretLike,
|
|
39
114
|
/,
|
|
40
|
-
*
|
|
115
|
+
*cmds_or_args: SecretLike,
|
|
116
|
+
env: StrStrMapping | None = None,
|
|
41
117
|
print: bool = False, # noqa: A002
|
|
42
118
|
return_: bool = False,
|
|
43
119
|
) -> str | None:
|
|
44
|
-
|
|
45
|
-
LOGGER.info("Running '%s'...", " ".join(map(str,
|
|
46
|
-
unwrapped
|
|
47
|
-
|
|
120
|
+
cmds_and_args = [cmd, *cmds_or_args]
|
|
121
|
+
LOGGER.info("Running '%s'...", " ".join(map(str, cmds_and_args)))
|
|
122
|
+
unwrapped: list[str] = []
|
|
123
|
+
for ca in cmds_and_args:
|
|
124
|
+
match ca:
|
|
125
|
+
case Secret():
|
|
126
|
+
unwrapped.append(ca.get_secret_value())
|
|
127
|
+
case str():
|
|
128
|
+
unwrapped.append(ca)
|
|
129
|
+
case never:
|
|
130
|
+
assert_never(never)
|
|
131
|
+
return run(*unwrapped, env=env, print=print, return_=return_, logger=LOGGER)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def write_text(
|
|
135
|
+
path: PathLike, text: str, /, *, modifications: MutableSet[Path] | None = None
|
|
136
|
+
) -> None:
|
|
137
|
+
LOGGER.info("Writing '%s'...", str(path))
|
|
138
|
+
with writer(path, overwrite=True) as temp:
|
|
139
|
+
_ = temp.write_text(ensure_new_line(text))
|
|
140
|
+
if modifications is not None:
|
|
141
|
+
modifications.add(Path(path))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def yaml_dump(obj: Any, /) -> str:
|
|
145
|
+
stream = StringIO()
|
|
146
|
+
YAML_INSTANCE.dump(obj, stream)
|
|
147
|
+
return stream.getvalue()
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
##
|
|
48
151
|
|
|
49
152
|
|
|
50
|
-
__all__ = [
|
|
153
|
+
__all__ = [
|
|
154
|
+
"LOADER",
|
|
155
|
+
"are_equal_modulo_new_line",
|
|
156
|
+
"convert_list_strs",
|
|
157
|
+
"convert_secret_str",
|
|
158
|
+
"convert_str",
|
|
159
|
+
"copy_text",
|
|
160
|
+
"ensure_new_line",
|
|
161
|
+
"logged_run",
|
|
162
|
+
"write_text",
|
|
163
|
+
"yaml_dump",
|
|
164
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: dycw-actions
|
|
3
|
+
Version: 0.7.1
|
|
4
|
+
Summary: Library of actions
|
|
5
|
+
Requires-Dist: click>=8.3.1,<9
|
|
6
|
+
Requires-Dist: dycw-utilities>=0.177.0,<1
|
|
7
|
+
Requires-Dist: inflect>=7.5.0,<8
|
|
8
|
+
Requires-Dist: libcst>=1.8.6,<2
|
|
9
|
+
Requires-Dist: packaging>=25.0,<26
|
|
10
|
+
Requires-Dist: pydantic>=2.12.5,<3
|
|
11
|
+
Requires-Dist: pyyaml>=6.0.3,<7
|
|
12
|
+
Requires-Dist: rich>=14.2.0,<15
|
|
13
|
+
Requires-Dist: ruamel-yaml>=0.19.0,<1
|
|
14
|
+
Requires-Dist: tomlkit>=0.13.3,<1
|
|
15
|
+
Requires-Dist: typed-settings[attrs,click]>=25.3.0,<26
|
|
16
|
+
Requires-Dist: xdg-base-dirs>=6.0.2,<7
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# `actions`
|
|
21
|
+
|
|
22
|
+
Library of actions
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
actions/__init__.py,sha256=_OevY0-QRr7A22CyPm0BKMCDflx5qu_IVMMkCcVHxdE,58
|
|
2
|
+
actions/action_dicts/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
3
|
+
actions/action_dicts/constants.py,sha256=tYYLr3aRRRvnR6NSADOJMN-B6gtqg2A9gBuheEPyGy4,189
|
|
4
|
+
actions/action_dicts/lib.py,sha256=MpK_y5Jao0-3p6bWeYX5QQy3-JjMxwyzXRU5LjO25Iw,5547
|
|
5
|
+
actions/clean_dir/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
6
|
+
actions/clean_dir/cli.py,sha256=OrFA2nEN2LyGF22mhTNEBr7KSuKgX54sGy9RyE73qUc,569
|
|
7
|
+
actions/clean_dir/constants.py,sha256=aDNaYtemEv3lcMXo96Oh4pw_HASMby1GZC1D_gbjPAc,167
|
|
8
|
+
actions/clean_dir/lib.py,sha256=s8FdQBd9-PVmPixWFRmpcK6oOHrdutIxtsCSf1N1Tws,1577
|
|
9
|
+
actions/clean_dir/settings.py,sha256=mqM0Oq-yz4dXKcUi3JmOCvDhoeBNQm_Qe70cGmhdcQE,345
|
|
10
|
+
actions/cli.py,sha256=NPiRNWXUyYLcalbDdsQaYDtjdkfSPvR3i6SyVrD5NUQ,4079
|
|
11
|
+
actions/constants.py,sha256=SO0SBwEW8Wn5Uzt95OvlwTctyH0K7uvXMnNf1uCkrxk,212
|
|
12
|
+
actions/logging.py,sha256=rMTcQMGndUHTCaXXtyOHt_VXUMhQGRHoN7okpoX0y5I,120
|
|
13
|
+
actions/pre_commit/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
14
|
+
actions/pre_commit/click.py,sha256=BLHjkO0gIW7rgLabuWnszwXmI4yb8Li5D8gt81GR-FQ,270
|
|
15
|
+
actions/pre_commit/conformalize_repo/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
16
|
+
actions/pre_commit/conformalize_repo/cli.py,sha256=rPrxobdo4sKnq0de_UWDtrHqlhF6GTAabRhw_1XBeZY,3063
|
|
17
|
+
actions/pre_commit/conformalize_repo/configs/gitignore,sha256=8YCRPwysCD8-67yFXaTg6O8TTl4xeNIh7_DVmaU5Ix0,5063
|
|
18
|
+
actions/pre_commit/conformalize_repo/constants.py,sha256=7WMbc1BwkVPJIf3eh3MaCoWj5A7pSPvNic28nrFTcoA,2148
|
|
19
|
+
actions/pre_commit/conformalize_repo/lib.py,sha256=rgUQjX1ScjQcLeXx9cPqFqGYQmHprUhDodxEjp7RonM,47604
|
|
20
|
+
actions/pre_commit/conformalize_repo/settings.py,sha256=Oz2AeStS64DFzT1HKJ888_7tiU1TdJIGBarvyKYfp4E,4985
|
|
21
|
+
actions/pre_commit/constants.py,sha256=NBJ5GBMg5qhMAhAfxx1FKw0CdPwW_wG2cUJJ0dkF5HE,158
|
|
22
|
+
actions/pre_commit/format_requirements/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
23
|
+
actions/pre_commit/format_requirements/cli.py,sha256=c9UdOFDLEei5AEzrVvo6FopIEOf2EqyOliA-bOR5a2o,584
|
|
24
|
+
actions/pre_commit/format_requirements/constants.py,sha256=ly41jgwq0VVyHQqHaIXRc5ZmbWrNY_C3ET4G9gtE7rI,228
|
|
25
|
+
actions/pre_commit/format_requirements/lib.py,sha256=AGgtJ-4fBesv-BSFYExLu5rcLV6hfElVk1IxNtCXIAs,1399
|
|
26
|
+
actions/pre_commit/replace_sequence_strs/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
27
|
+
actions/pre_commit/replace_sequence_strs/cli.py,sha256=S8T-p0ex5lLmJz-5G7xDwPYnrwV82mf8UtwWtLIr36E,594
|
|
28
|
+
actions/pre_commit/replace_sequence_strs/constants.py,sha256=yEEgJUpw3URzv8Cb4nIgBY2xAzEfJIF6yzyUy6K55J4,250
|
|
29
|
+
actions/pre_commit/replace_sequence_strs/lib.py,sha256=FzfwYeL3bhTCYbb1T-Yk1NtdH3SFNKFC2x0JgdT4bXA,2166
|
|
30
|
+
actions/pre_commit/touch_empty_py/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
31
|
+
actions/pre_commit/touch_empty_py/cli.py,sha256=s2S5OfAGcSLtd2aGm1ooa1k20oNK-LQ1PZWz6T30vO8,559
|
|
32
|
+
actions/pre_commit/touch_empty_py/constants.py,sha256=zSwH60zfn9RhIAbBFnXjHrm2s1nFpPUskX3CZuJpQLk,198
|
|
33
|
+
actions/pre_commit/touch_empty_py/lib.py,sha256=avGiqWRi0x7E4zvvyxaqv_ccRpOT8Le7ol4_ETaXx2s,1458
|
|
34
|
+
actions/pre_commit/touch_py_typed/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
35
|
+
actions/pre_commit/touch_py_typed/cli.py,sha256=CDJV4NuUHJlSdJ84dY0XvdwYHMdqygZ7C6x07B-iN3E,559
|
|
36
|
+
actions/pre_commit/touch_py_typed/constants.py,sha256=kLZOm_wgypp7MaXRYq-6AZqVE4OttOMKmUqt11V2zn0,191
|
|
37
|
+
actions/pre_commit/touch_py_typed/lib.py,sha256=Vsi1oDC6nUvWlQdA_a5t-kM5W5o3v0PBZZQe3_QS3Zo,1772
|
|
38
|
+
actions/pre_commit/update_requirements/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
39
|
+
actions/pre_commit/update_requirements/classes.py,sha256=STRC3LS_2PkdvHPgPxkNAcSIDiomzsKhyiP5uhcLUe0,3266
|
|
40
|
+
actions/pre_commit/update_requirements/cli.py,sha256=CBfm8M7hwSRw8KS6ttiNE86IFHJ52V42AxlfakqTDN0,584
|
|
41
|
+
actions/pre_commit/update_requirements/constants.py,sha256=ve44_RYed_41ckgQNPkb08u7Y1cpLpzutGSL9FdGBF8,228
|
|
42
|
+
actions/pre_commit/update_requirements/lib.py,sha256=o3wUfeof-6oLYziHE74Q8WIHk4nyOv5PcK8cFkazm1k,4107
|
|
43
|
+
actions/pre_commit/utilities.py,sha256=L1HCi3l778REPfomMuYbxrrnCn0FDRFaWAfmFR0lsTY,11422
|
|
44
|
+
actions/publish_package/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
45
|
+
actions/publish_package/cli.py,sha256=nAPHCq67mxUb3yHepVGcoQ69qgaQahM1-cxdbHfxQg0,803
|
|
46
|
+
actions/publish_package/constants.py,sha256=C68ZCVL_jVlYdLGpOK6saZccWoFy5AmC_NMBIWYdYOE,209
|
|
47
|
+
actions/publish_package/lib.py,sha256=WSGpXtZsTWL5tkoih4VTKLvtX6B8KmsO1jolT83S22A,1754
|
|
48
|
+
actions/publish_package/settings.py,sha256=UucS_yb-es9bDz0EPeWTIql6B1Dr4kcaEMdXpt23BNQ,935
|
|
49
|
+
actions/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
actions/random_sleep/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
51
|
+
actions/random_sleep/cli.py,sha256=-d9y63oWgvQtNp9j_8v3zt5gKl-GrUq8-b3Ky52R42c,693
|
|
52
|
+
actions/random_sleep/constants.py,sha256=5GMqCD1f12uyKDVTZBbnDDn6TQa99mUYZb9p-crg5BA,190
|
|
53
|
+
actions/random_sleep/lib.py,sha256=JzgpeEONdKXSBeNc3ex9goVyJR3bsa76lB_tkH1Ggc0,1762
|
|
54
|
+
actions/random_sleep/settings.py,sha256=F8gO2j2EEX8moemwhWWCPdRuOpZ_qLtqzSfWhjIy3P8,529
|
|
55
|
+
actions/run_hooks/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
56
|
+
actions/run_hooks/cli.py,sha256=xKBw6iIlHpUlHl6-QWQLSL6KKVjnsihBeJ7h58Rl8P4,616
|
|
57
|
+
actions/run_hooks/constants.py,sha256=JRhDk08qbzo5C-zwHdXZV5ajvNSKh4GcOcBvOIY6IGU,172
|
|
58
|
+
actions/run_hooks/lib.py,sha256=a-eUOtgTouxJYCsLRjsPIXl6nP58T2RB4jhr-Hhz0Sg,2850
|
|
59
|
+
actions/run_hooks/settings.py,sha256=XbQe1j1oEvDnbl4H6B-YEY6Ms6qlsj-N2XSJhdVHCWA,606
|
|
60
|
+
actions/setup_cronjob/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
61
|
+
actions/setup_cronjob/cli.py,sha256=l6t2WjCUprACV0rY8kHvpHLt3LgMI4q2XY4AEOiutkk,891
|
|
62
|
+
actions/setup_cronjob/configs/cron.tmpl,sha256=UD_d0LYlB6tbkXAcUTzpGDWVNgIhCR45Jgky91iSCP8,412
|
|
63
|
+
actions/setup_cronjob/configs/logrotate.tmpl,sha256=kkMuCRe4l03er6cFmRI0CXerHYmDumnMXLGKBjXLVxo,137
|
|
64
|
+
actions/setup_cronjob/constants.py,sha256=CNebyWFymrXBx3X9X7XXpU9PSd5wzUN6XkUVomSBnWQ,301
|
|
65
|
+
actions/setup_cronjob/lib.py,sha256=p6ndCc4e01pS-aLK_Qqn26qSto9krt26cOR23m4YiYg,3411
|
|
66
|
+
actions/setup_cronjob/settings.py,sha256=SxSe25f0sHUgq2-xdJN6rbbaSVFQE7FuEisiO_fmZNw,990
|
|
67
|
+
actions/tag_commit/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
68
|
+
actions/tag_commit/cli.py,sha256=1E6cM0XKTCt_Ukb7pxqOojHpJjoa63dVBO6DXoESe9Q,745
|
|
69
|
+
actions/tag_commit/constants.py,sha256=ceOvQpY4dgtJSd7v_jI1V00S0SjRq2ToGeZu41-DL7M,176
|
|
70
|
+
actions/tag_commit/lib.py,sha256=rq1SqAkNp98cPsNOsFY4F1D6nNi7N3wqVbFPno8lsuI,1849
|
|
71
|
+
actions/tag_commit/settings.py,sha256=TOeKG_GODP--2lBSyGzH_M32jDIfh4vk_Ts06R3_ak4,629
|
|
72
|
+
actions/types.py,sha256=GRXLoJtYWmRjgfatDDRMcXKZkN9ZtK1Fi2MEyAZ84uk,591
|
|
73
|
+
actions/utilities.py,sha256=VpFLBiAezgSRlm9dvnyPyQohreaV2Lv7cJ9HAxqZ4WI,4086
|
|
74
|
+
dycw_actions-0.7.1.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
|
|
75
|
+
dycw_actions-0.7.1.dist-info/entry_points.txt,sha256=2Uu7wAZOm0mmcsGBEsGB370HAWgVWECRFJ9rKgfC3-I,46
|
|
76
|
+
dycw_actions-0.7.1.dist-info/METADATA,sha256=T4208DBQxD3yT09fwfKIiVGyOvSax8tyqNt8MxNGBLM,619
|
|
77
|
+
dycw_actions-0.7.1.dist-info/RECORD,,
|
actions/publish/cli.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from rich.pretty import pretty_repr
|
|
4
|
-
from typed_settings import click_options
|
|
5
|
-
from utilities.logging import basic_config
|
|
6
|
-
from utilities.os import is_pytest
|
|
7
|
-
from utilities.text import strip_and_dedent
|
|
8
|
-
|
|
9
|
-
from actions import __version__
|
|
10
|
-
from actions.logging import LOGGER
|
|
11
|
-
from actions.publish.lib import publish_package
|
|
12
|
-
from actions.publish.settings import PublishSettings
|
|
13
|
-
from actions.settings import CommonSettings
|
|
14
|
-
from actions.utilities import LOADER
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@click_options(CommonSettings, [LOADER], show_envvars_in_help=True, argname="common")
|
|
18
|
-
@click_options(PublishSettings, [LOADER], show_envvars_in_help=True, argname="publish")
|
|
19
|
-
def publish_sub_cmd(*, common: CommonSettings, publish: PublishSettings) -> None:
|
|
20
|
-
if is_pytest():
|
|
21
|
-
return
|
|
22
|
-
basic_config(obj=LOGGER)
|
|
23
|
-
LOGGER.info(
|
|
24
|
-
strip_and_dedent("""
|
|
25
|
-
Running '%r' (version %s) with settings:
|
|
26
|
-
%s
|
|
27
|
-
%s
|
|
28
|
-
"""),
|
|
29
|
-
publish_package.__name__,
|
|
30
|
-
__version__,
|
|
31
|
-
pretty_repr(common),
|
|
32
|
-
pretty_repr(publish),
|
|
33
|
-
)
|
|
34
|
-
publish_package(
|
|
35
|
-
username=publish.username,
|
|
36
|
-
password=publish.password,
|
|
37
|
-
publish_url=publish.publish_url,
|
|
38
|
-
trusted_publishing=publish.trusted_publishing,
|
|
39
|
-
native_tls=publish.native_tls,
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
__all__ = ["publish_sub_cmd"]
|
actions/settings.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typed_settings import Secret, load_settings, secret, settings
|
|
4
|
-
|
|
5
|
-
from actions.utilities import LOADER, empty_str_to_none
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@settings
|
|
9
|
-
class CommonSettings:
|
|
10
|
-
token: Secret[str] | None = secret(
|
|
11
|
-
default=None, converter=empty_str_to_none, help="GitHub token"
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
COMMON_SETTINGS = load_settings(CommonSettings, [LOADER])
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
__all__ = ["COMMON_SETTINGS", "CommonSettings"]
|
actions/sleep/cli.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from rich.pretty import pretty_repr
|
|
4
|
-
from typed_settings import click_options
|
|
5
|
-
from utilities.logging import basic_config
|
|
6
|
-
from utilities.os import is_pytest
|
|
7
|
-
from utilities.text import strip_and_dedent
|
|
8
|
-
|
|
9
|
-
from actions import __version__
|
|
10
|
-
from actions.logging import LOGGER
|
|
11
|
-
from actions.settings import CommonSettings
|
|
12
|
-
from actions.sleep.lib import random_sleep
|
|
13
|
-
from actions.sleep.settings import SleepSettings
|
|
14
|
-
from actions.utilities import LOADER
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@click_options(CommonSettings, [LOADER], show_envvars_in_help=True, argname="common")
|
|
18
|
-
@click_options(SleepSettings, [LOADER], show_envvars_in_help=True, argname="sleep")
|
|
19
|
-
def sleep_sub_cmd(*, common: CommonSettings, sleep: SleepSettings) -> None:
|
|
20
|
-
if is_pytest():
|
|
21
|
-
return
|
|
22
|
-
basic_config(obj=LOGGER)
|
|
23
|
-
LOGGER.info(
|
|
24
|
-
strip_and_dedent("""
|
|
25
|
-
Running '%r' (version %s) with settings:
|
|
26
|
-
%s
|
|
27
|
-
%s
|
|
28
|
-
"""),
|
|
29
|
-
random_sleep.__name__,
|
|
30
|
-
__version__,
|
|
31
|
-
pretty_repr(common),
|
|
32
|
-
pretty_repr(sleep),
|
|
33
|
-
)
|
|
34
|
-
random_sleep(
|
|
35
|
-
min_=sleep.min, max_=sleep.max, step=sleep.step, log_freq=sleep.log_freq
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
__all__ = ["sleep_sub_cmd"]
|
actions/tag/cli.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from rich.pretty import pretty_repr
|
|
4
|
-
from typed_settings import click_options
|
|
5
|
-
from utilities.logging import basic_config
|
|
6
|
-
from utilities.os import is_pytest
|
|
7
|
-
from utilities.text import strip_and_dedent
|
|
8
|
-
|
|
9
|
-
from actions import __version__
|
|
10
|
-
from actions.logging import LOGGER
|
|
11
|
-
from actions.settings import CommonSettings
|
|
12
|
-
from actions.tag.lib import tag_commit
|
|
13
|
-
from actions.tag.settings import TagSettings
|
|
14
|
-
from actions.utilities import LOADER
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@click_options(CommonSettings, [LOADER], show_envvars_in_help=True, argname="common")
|
|
18
|
-
@click_options(TagSettings, [LOADER], show_envvars_in_help=True, argname="tag")
|
|
19
|
-
def tag_sub_cmd(*, common: CommonSettings, tag: TagSettings) -> None:
|
|
20
|
-
if is_pytest():
|
|
21
|
-
return
|
|
22
|
-
basic_config(obj=LOGGER)
|
|
23
|
-
LOGGER.info(
|
|
24
|
-
strip_and_dedent("""
|
|
25
|
-
Running '%r' (version %s) with settings:
|
|
26
|
-
%s
|
|
27
|
-
%s
|
|
28
|
-
"""),
|
|
29
|
-
tag_commit.__name__,
|
|
30
|
-
__version__,
|
|
31
|
-
pretty_repr(common),
|
|
32
|
-
pretty_repr(tag),
|
|
33
|
-
)
|
|
34
|
-
tag_commit(
|
|
35
|
-
user_name=tag.user_name,
|
|
36
|
-
user_email=tag.user_email,
|
|
37
|
-
major_minor=tag.major_minor,
|
|
38
|
-
major=tag.major,
|
|
39
|
-
latest=tag.latest,
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
__all__ = ["tag_sub_cmd"]
|
actions/tag/lib.py
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from contextlib import suppress
|
|
4
|
-
from subprocess import CalledProcessError
|
|
5
|
-
|
|
6
|
-
from utilities.version import parse_version
|
|
7
|
-
|
|
8
|
-
from actions import __version__
|
|
9
|
-
from actions.logging import LOGGER
|
|
10
|
-
from actions.tag.settings import TAG_SETTINGS
|
|
11
|
-
from actions.utilities import log_run
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def tag_commit(
|
|
15
|
-
*,
|
|
16
|
-
user_name: str = TAG_SETTINGS.user_name,
|
|
17
|
-
user_email: str = TAG_SETTINGS.user_email,
|
|
18
|
-
major_minor: bool = TAG_SETTINGS.major_minor,
|
|
19
|
-
major: bool = TAG_SETTINGS.major,
|
|
20
|
-
latest: bool = TAG_SETTINGS.latest,
|
|
21
|
-
) -> None:
|
|
22
|
-
LOGGER.info(
|
|
23
|
-
"""\
|
|
24
|
-
Running %r (version %s) with settings:
|
|
25
|
-
- user_name = %s
|
|
26
|
-
- user_email = %s
|
|
27
|
-
- major_minor = %s
|
|
28
|
-
- major = %s
|
|
29
|
-
- latest = %s
|
|
30
|
-
""",
|
|
31
|
-
tag_commit.__name__,
|
|
32
|
-
__version__,
|
|
33
|
-
user_name,
|
|
34
|
-
user_email,
|
|
35
|
-
major_minor,
|
|
36
|
-
major,
|
|
37
|
-
latest,
|
|
38
|
-
)
|
|
39
|
-
_ = log_run("git", "config", "--global", "user.name", user_name)
|
|
40
|
-
_ = log_run("git", "config", "--global", "user.email", user_email)
|
|
41
|
-
version = parse_version(
|
|
42
|
-
log_run("bump-my-version", "show", "current_version", return_=True)
|
|
43
|
-
)
|
|
44
|
-
_tag(str(version))
|
|
45
|
-
if major_minor:
|
|
46
|
-
_tag(f"{version.major}.{version.minor}")
|
|
47
|
-
if major:
|
|
48
|
-
_tag(str(version.major))
|
|
49
|
-
if latest:
|
|
50
|
-
_tag("latest")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def _tag(version: str, /) -> None:
|
|
54
|
-
with suppress(CalledProcessError):
|
|
55
|
-
_ = log_run("git", "tag", "--delete", version)
|
|
56
|
-
with suppress(CalledProcessError):
|
|
57
|
-
_ = log_run("git", "push", "--delete", "origin", version)
|
|
58
|
-
_ = log_run("git", "tag", "-a", version, "HEAD", "-m", version)
|
|
59
|
-
_ = log_run("git", "push", "--tags", "--force", "--set-upstream", "origin")
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
__all__ = ["tag_commit"]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: dycw-actions
|
|
3
|
-
Version: 0.3.2
|
|
4
|
-
Summary: GitHub actions
|
|
5
|
-
Requires-Dist: click>=8.3.1,<8.4
|
|
6
|
-
Requires-Dist: dycw-utilities>=0.172.5,<0.173
|
|
7
|
-
Requires-Dist: rich>=14.2.0,<14.3
|
|
8
|
-
Requires-Dist: typed-settings[attrs,click]>=25.3.0,<25.4
|
|
9
|
-
Requires-Python: >=3.13
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
|
|
12
|
-
# `actions`
|
|
13
|
-
|
|
14
|
-
GitHub actions
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
actions/__init__.py,sha256=xm1u7RHIf6fYv7ou5-vxQ9OiaAwZ0vJK7AngPQ7IBek,58
|
|
2
|
-
actions/cli.py,sha256=S2q5iRqZ-AsB-IF0GxExRBBnguPcKRH_97o-kxg-RLU,536
|
|
3
|
-
actions/logging.py,sha256=rMTcQMGndUHTCaXXtyOHt_VXUMhQGRHoN7okpoX0y5I,120
|
|
4
|
-
actions/publish/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
5
|
-
actions/publish/cli.py,sha256=dcodn7jxjfaf2OfWaZh1ae5j2fZ5jXlma1OXkeRcSw4,1334
|
|
6
|
-
actions/publish/lib.py,sha256=4efV3RnJNrPPebCHS_a6FzSRM9ifFJtBXZXXc5ORNFw,1651
|
|
7
|
-
actions/publish/settings.py,sha256=4WgKG_ZhGkrlyRActam2ponIHZDu5U9aQHrnO2F1Vi4,969
|
|
8
|
-
actions/settings.py,sha256=nLebb6eRHcY2F48WTuFrF8ir4v6mT_cTWs9e4VHRGMA,421
|
|
9
|
-
actions/sleep/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
10
|
-
actions/sleep/cli.py,sha256=ilPHPYygoIQgG_Nggot2w5vNKdes0L6XxUG6Pb67DmI,1181
|
|
11
|
-
actions/sleep/lib.py,sha256=uMre9J4A4ZEOfDntxn-PZmi7glaHI_QaXuZmmvpq0go,1660
|
|
12
|
-
actions/sleep/settings.py,sha256=1hMd5mUsFb6gLajdAZ8bvFYjDhE1BWiPSKOYiHJEvqM,556
|
|
13
|
-
actions/tag/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
14
|
-
actions/tag/cli.py,sha256=5mZ7inpLAdtIkQXp4c-t2C3Iw7tnJedR8GRN0ijatco,1231
|
|
15
|
-
actions/tag/lib.py,sha256=Xoc3i6kR0jCbakDOlGDN8eO8PiPe1shc0egcaCkC0jQ,1723
|
|
16
|
-
actions/tag/settings.py,sha256=s6QBI4bZFjk2mIPKIlyb3sLET5ZpXsTb-2bzjW9m5Ew,646
|
|
17
|
-
actions/types.py,sha256=4k6WkQ0ByQxzJtajoufdx8VQ9xAPPq6WU4nseQcwmyw,134
|
|
18
|
-
actions/utilities.py,sha256=OkwoVUd00JtBctCUlVuAriMjMPRl8W8nJorgWpedOkI,1222
|
|
19
|
-
dycw_actions-0.3.2.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
|
|
20
|
-
dycw_actions-0.3.2.dist-info/entry_points.txt,sha256=2Uu7wAZOm0mmcsGBEsGB370HAWgVWECRFJ9rKgfC3-I,46
|
|
21
|
-
dycw_actions-0.3.2.dist-info/METADATA,sha256=NPpbP9_F61qYpr7HhvXM99AKBYT68ec45CP3EMcipoE,343
|
|
22
|
-
dycw_actions-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|