dycw-actions 0.7.7__py3-none-any.whl → 0.8.4__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/constants.py +60 -1
- actions/pre_commit/conformalize_repo/action_dicts.py +247 -0
- actions/pre_commit/conformalize_repo/cli.py +14 -14
- actions/pre_commit/conformalize_repo/constants.py +2 -38
- actions/pre_commit/conformalize_repo/lib.py +289 -227
- actions/pre_commit/conformalize_repo/settings.py +37 -33
- actions/pre_commit/update_requirements/lib.py +1 -2
- actions/pre_commit/utilities.py +3 -4
- actions/run_hooks/lib.py +13 -4
- actions/run_hooks/settings.py +3 -0
- actions/types.py +2 -2
- {dycw_actions-0.7.7.dist-info → dycw_actions-0.8.4.dist-info}/METADATA +2 -2
- {dycw_actions-0.7.7.dist-info → dycw_actions-0.8.4.dist-info}/RECORD +16 -18
- actions/action_dicts/__init__.py +0 -1
- actions/action_dicts/constants.py +0 -8
- actions/action_dicts/lib.py +0 -186
- {dycw_actions-0.7.7.dist-info → dycw_actions-0.8.4.dist-info}/WHEEL +0 -0
- {dycw_actions-0.7.7.dist-info → dycw_actions-0.8.4.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typed_settings import load_settings, option, settings
|
|
3
|
+
from typed_settings import Secret, load_settings, option, secret, settings
|
|
4
4
|
|
|
5
5
|
from actions.pre_commit.conformalize_repo.constants import RUN_VERSION_BUMP
|
|
6
6
|
from actions.utilities import LOADER
|
|
@@ -8,47 +8,53 @@ from actions.utilities import LOADER
|
|
|
8
8
|
|
|
9
9
|
@settings
|
|
10
10
|
class Settings:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
ci__ca_certificates: bool = option(
|
|
12
|
+
default=False, help="Update CA certficates before each step"
|
|
13
|
+
)
|
|
14
|
+
ci__gitea: bool = option(default=False, help="Set up CI on Gitea")
|
|
15
|
+
ci__token: str | None = option(default=None, help="Set up CI with this token")
|
|
16
|
+
ci__pull_request__pre_commit: bool = option(
|
|
17
|
+
default=False, help="Set up CI 'pull-request.yaml' pre-commit"
|
|
17
18
|
)
|
|
18
|
-
|
|
19
|
-
default=False, help="Set up 'pull-request.yaml'
|
|
19
|
+
ci__pull_request__pyright: bool = option(
|
|
20
|
+
default=False, help="Set up CI 'pull-request.yaml' pyright"
|
|
20
21
|
)
|
|
21
|
-
|
|
22
|
-
default=False, help="Set up 'pull-request.yaml'
|
|
22
|
+
ci__pull_request__pytest__macos: bool = option(
|
|
23
|
+
default=False, help="Set up CI 'pull-request.yaml' pytest with MacOS"
|
|
23
24
|
)
|
|
24
|
-
|
|
25
|
-
default=False, help="Set up 'pull-request.yaml'
|
|
25
|
+
ci__pull_request__pytest__ubuntu: bool = option(
|
|
26
|
+
default=False, help="Set up CI 'pull-request.yaml' pytest with Ubuntu"
|
|
26
27
|
)
|
|
27
|
-
|
|
28
|
-
default=False, help="Set up 'pull-request.yaml' pytest with
|
|
28
|
+
ci__pull_request__pytest__windows: bool = option(
|
|
29
|
+
default=False, help="Set up CI 'pull-request.yaml' pytest with Windows"
|
|
29
30
|
)
|
|
30
|
-
|
|
31
|
-
default=
|
|
31
|
+
ci__pull_request__pytest__sops_age_key: str | None = option(
|
|
32
|
+
default=None,
|
|
33
|
+
help="Set up CI 'pull-request.yaml' pytest with this 'age' key for 'sops'",
|
|
32
34
|
)
|
|
33
|
-
|
|
34
|
-
default=False, help="Set up 'pull-request.yaml'
|
|
35
|
+
ci__pull_request__ruff: bool = option(
|
|
36
|
+
default=False, help="Set up CI 'pull-request.yaml' ruff"
|
|
35
37
|
)
|
|
36
|
-
|
|
37
|
-
default=False, help="Set up '
|
|
38
|
+
ci__push__publish: bool = option(
|
|
39
|
+
default=False, help="Set up CI 'push.yaml' publishing"
|
|
38
40
|
)
|
|
39
|
-
|
|
40
|
-
default=
|
|
41
|
+
ci__push__publish__username: str | None = option(
|
|
42
|
+
default=None, help="Set up CI 'push.yaml' publishing with this username"
|
|
41
43
|
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
default=False, help="Set up 'push.yaml' with the 'major' tag"
|
|
44
|
+
ci__push__publish__password: Secret[str] | None = secret(
|
|
45
|
+
default=None, help="Set up CI 'push.yaml' publishing with this password"
|
|
45
46
|
)
|
|
46
|
-
|
|
47
|
-
default=
|
|
47
|
+
ci__push__publish__publish_url: Secret[str] | None = secret(
|
|
48
|
+
default=None, help="Set up CI 'push.yaml' publishing with this URL"
|
|
48
49
|
)
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
ci__push__tag: bool = option(default=False, help="Set up CI 'push.yaml' tagging")
|
|
51
|
+
ci__push__tag__all: bool = option(
|
|
52
|
+
default=False, help="Set up CI 'push.yaml' tagging with all tags"
|
|
51
53
|
)
|
|
54
|
+
coverage: bool = option(default=False, help="Set up '.coveragerc.toml'")
|
|
55
|
+
description: str | None = option(default=None, help="Repo description")
|
|
56
|
+
envrc: bool = option(default=False, help="Set up '.envrc'")
|
|
57
|
+
envrc__uv: bool = option(default=False, help="Set up '.envrc' with uv")
|
|
52
58
|
gitignore: bool = option(default=False, help="Set up '.gitignore'")
|
|
53
59
|
package_name: str | None = option(default=None, help="Package name")
|
|
54
60
|
pre_commit__dockerfmt: bool = option(
|
|
@@ -72,9 +78,6 @@ class Settings:
|
|
|
72
78
|
pre_commit__uv: bool = option(
|
|
73
79
|
default=False, help="Set up '.pre-commit-config.yaml' uv"
|
|
74
80
|
)
|
|
75
|
-
pre_commit__uv__script: str | None = option(
|
|
76
|
-
default=None, help="Set up '.pre-commit-config.yaml' uv lock script"
|
|
77
|
-
)
|
|
78
81
|
pyproject: bool = option(default=False, help="Set up 'pyproject.toml'")
|
|
79
82
|
pyproject__project__optional_dependencies__scripts: bool = option(
|
|
80
83
|
default=False,
|
|
@@ -100,6 +103,7 @@ class Settings:
|
|
|
100
103
|
repo_name: str | None = option(default=None, help="Repo name")
|
|
101
104
|
ruff: bool = option(default=False, help="Set up 'ruff.toml'")
|
|
102
105
|
run_version_bump: bool = option(default=RUN_VERSION_BUMP, help="Run version bump")
|
|
106
|
+
uv__native_tls: bool = option(default=False, help="Setup 'uv' with native TLS")
|
|
103
107
|
script: str | None = option(
|
|
104
108
|
default=None, help="Set up a script instead of a package"
|
|
105
109
|
)
|
|
@@ -27,10 +27,9 @@ if TYPE_CHECKING:
|
|
|
27
27
|
from pathlib import Path
|
|
28
28
|
|
|
29
29
|
from utilities.packaging import Requirement
|
|
30
|
-
from utilities.types import PathLike
|
|
30
|
+
from utilities.types import PathLike, StrDict
|
|
31
31
|
|
|
32
32
|
from actions.pre_commit.update_requirements.classes import Version2or3, VersionSet
|
|
33
|
-
from actions.types import StrDict
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
def update_requirements(*paths: PathLike) -> None:
|
actions/pre_commit/utilities.py
CHANGED
|
@@ -15,19 +15,18 @@ from tomlkit.items import AoT, Array, Table
|
|
|
15
15
|
from utilities.functions import ensure_class, ensure_str
|
|
16
16
|
from utilities.iterables import OneEmptyError, OneNonUniqueError, one
|
|
17
17
|
from utilities.packaging import Requirement
|
|
18
|
-
from utilities.types import PathLike
|
|
18
|
+
from utilities.types import PathLike, StrDict
|
|
19
19
|
|
|
20
20
|
from actions.constants import YAML_INSTANCE
|
|
21
21
|
from actions.logging import LOGGER
|
|
22
|
-
from actions.types import StrDict
|
|
23
22
|
from actions.utilities import are_equal_modulo_new_line, write_text, yaml_dump
|
|
24
23
|
|
|
25
24
|
if TYPE_CHECKING:
|
|
26
25
|
from collections.abc import Callable, Iterable, Iterator, MutableSet
|
|
27
26
|
|
|
28
|
-
from utilities.types import PathLike
|
|
27
|
+
from utilities.types import PathLike, StrDict
|
|
29
28
|
|
|
30
|
-
from actions.types import FuncRequirement, HasAppend, HasSetDefault
|
|
29
|
+
from actions.types import FuncRequirement, HasAppend, HasSetDefault
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
def ensure_aot_contains(array: AoT, /, *tables: Table) -> None:
|
actions/run_hooks/lib.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import time
|
|
4
|
+
from contextlib import suppress
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
from re import search
|
|
6
7
|
from subprocess import CalledProcessError
|
|
@@ -24,24 +25,27 @@ def run_hooks(
|
|
|
24
25
|
*,
|
|
25
26
|
repos: list[str] | None = SETTINGS.repos,
|
|
26
27
|
hooks: list[str] | None = SETTINGS.hooks,
|
|
28
|
+
hooks_exclude: list[str] | None = SETTINGS.hooks_exclude,
|
|
27
29
|
sleep: int = SETTINGS.sleep,
|
|
28
30
|
) -> None:
|
|
29
31
|
LOGGER.info(
|
|
30
32
|
strip_and_dedent("""
|
|
31
33
|
Running '%s' (version %s) with settings:
|
|
32
|
-
- repos
|
|
33
|
-
- hooks
|
|
34
|
-
-
|
|
34
|
+
- repos = %s
|
|
35
|
+
- hooks = %s
|
|
36
|
+
- hooks_exclude = %s
|
|
37
|
+
- sleep = %d
|
|
35
38
|
"""),
|
|
36
39
|
run_hooks.__name__,
|
|
37
40
|
__version__,
|
|
38
41
|
repos,
|
|
39
42
|
hooks,
|
|
43
|
+
hooks_exclude,
|
|
40
44
|
sleep,
|
|
41
45
|
)
|
|
42
46
|
results = {
|
|
43
47
|
hook: _run_hook(hook, sleep=sleep)
|
|
44
|
-
for hook in _yield_hooks(repos=repos, hooks=hooks)
|
|
48
|
+
for hook in _yield_hooks(repos=repos, hooks=hooks, hooks_exclude=hooks_exclude)
|
|
45
49
|
}
|
|
46
50
|
failed = {hook: result for hook, result in results.items() if not result}
|
|
47
51
|
if len(failed) >= 1:
|
|
@@ -53,6 +57,7 @@ def _yield_hooks(
|
|
|
53
57
|
*,
|
|
54
58
|
repos: list[str] | None = SETTINGS.repos,
|
|
55
59
|
hooks: list[str] | None = SETTINGS.hooks,
|
|
60
|
+
hooks_exclude: list[str] | None = SETTINGS.hooks_exclude,
|
|
56
61
|
) -> Iterator[str]:
|
|
57
62
|
dict_ = safe_load(Path(".pre-commit-config.yaml").read_text())
|
|
58
63
|
repos_list = ensure_class(dict_["repos"], list)
|
|
@@ -65,6 +70,10 @@ def _yield_hooks(
|
|
|
65
70
|
for hook in _yield_repo_hooks(repo):
|
|
66
71
|
if any(search(hook_i, hook) for hook_i in hooks):
|
|
67
72
|
results.add(hook)
|
|
73
|
+
if hooks_exclude is not None:
|
|
74
|
+
for hook in hooks_exclude:
|
|
75
|
+
with suppress(KeyError):
|
|
76
|
+
results.remove(hook)
|
|
68
77
|
yield from sorted(results)
|
|
69
78
|
|
|
70
79
|
|
actions/run_hooks/settings.py
CHANGED
|
@@ -15,6 +15,9 @@ class Settings:
|
|
|
15
15
|
hooks: list[str] | None = option(
|
|
16
16
|
default=None, converter=convert_list_strs, help="The hooks to be run"
|
|
17
17
|
)
|
|
18
|
+
hooks_exclude: list[str] | None = option(
|
|
19
|
+
default=None, converter=convert_list_strs, help="The hooks not to be run"
|
|
20
|
+
)
|
|
18
21
|
sleep: int = option(default=1, help="Sleep in between runs")
|
|
19
22
|
|
|
20
23
|
|
actions/types.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
6
6
|
from tomlkit.items import Array, Table
|
|
7
7
|
from typed_settings import Secret
|
|
8
8
|
from utilities.packaging import Requirement
|
|
9
|
+
from utilities.types import StrDict
|
|
9
10
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
11
12
|
from tomlkit.container import Container
|
|
@@ -15,7 +16,6 @@ type FuncRequirement = Callable[[Requirement], Requirement]
|
|
|
15
16
|
type HasAppend = Array | list[Any]
|
|
16
17
|
type HasSetDefault = Container | StrDict | Table
|
|
17
18
|
type SecretLike = str | Secret[str]
|
|
18
|
-
type StrDict = dict[str, Any]
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
__all__ = ["FuncRequirement", "HasAppend", "HasSetDefault", "SecretLike"
|
|
21
|
+
__all__ = ["FuncRequirement", "HasAppend", "HasSetDefault", "SecretLike"]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dycw-actions
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.4
|
|
4
4
|
Summary: Library of actions
|
|
5
5
|
Requires-Dist: click>=8.3.1,<9
|
|
6
|
-
Requires-Dist: dycw-utilities>=0.
|
|
6
|
+
Requires-Dist: dycw-utilities>=0.179.0,<1
|
|
7
7
|
Requires-Dist: inflect>=7.5.0,<8
|
|
8
8
|
Requires-Dist: libcst>=1.8.6,<2
|
|
9
9
|
Requires-Dist: packaging>=25.0,<26
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
actions/__init__.py,sha256=
|
|
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
|
|
1
|
+
actions/__init__.py,sha256=H8mH4w15RqfIw35Zak8l6adkEaCxYcUWrU66Ygj9eb0,58
|
|
5
2
|
actions/clean_dir/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
6
3
|
actions/clean_dir/cli.py,sha256=OrFA2nEN2LyGF22mhTNEBr7KSuKgX54sGy9RyE73qUc,569
|
|
7
4
|
actions/clean_dir/constants.py,sha256=aDNaYtemEv3lcMXo96Oh4pw_HASMby1GZC1D_gbjPAc,167
|
|
8
5
|
actions/clean_dir/lib.py,sha256=7_-QbvB9Bq2veEl4eYWkBBWN0jSNrjGVlx1gLWS1PwU,1606
|
|
9
6
|
actions/clean_dir/settings.py,sha256=mqM0Oq-yz4dXKcUi3JmOCvDhoeBNQm_Qe70cGmhdcQE,345
|
|
10
7
|
actions/cli.py,sha256=J9k7_BQzgDHdgzkTqwXVzncRMHm0eAT0WW_c_gAUFlE,4441
|
|
11
|
-
actions/constants.py,sha256=
|
|
8
|
+
actions/constants.py,sha256=C_eTTPwNJRjXV5BkFqdHMC2yQW86-iNTOCZjHYkMix0,1776
|
|
12
9
|
actions/logging.py,sha256=rMTcQMGndUHTCaXXtyOHt_VXUMhQGRHoN7okpoX0y5I,120
|
|
13
10
|
actions/pre_commit/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
14
11
|
actions/pre_commit/click.py,sha256=BLHjkO0gIW7rgLabuWnszwXmI4yb8Li5D8gt81GR-FQ,270
|
|
15
12
|
actions/pre_commit/conformalize_repo/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
16
|
-
actions/pre_commit/conformalize_repo/
|
|
13
|
+
actions/pre_commit/conformalize_repo/action_dicts.py,sha256=6KVL5xeQ8fSAjPpgRnDmKV9lsqqJJND7VvHNBqMgjs8,7605
|
|
14
|
+
actions/pre_commit/conformalize_repo/cli.py,sha256=1og2QndEIvOgub_az3Nk3KOLWSaae6eARpBMw22eUu4,2891
|
|
17
15
|
actions/pre_commit/conformalize_repo/configs/gitignore,sha256=8YCRPwysCD8-67yFXaTg6O8TTl4xeNIh7_DVmaU5Ix0,5063
|
|
18
|
-
actions/pre_commit/conformalize_repo/constants.py,sha256=
|
|
19
|
-
actions/pre_commit/conformalize_repo/lib.py,sha256=
|
|
20
|
-
actions/pre_commit/conformalize_repo/settings.py,sha256=
|
|
16
|
+
actions/pre_commit/conformalize_repo/constants.py,sha256=s96CbNkfghrxQSJSWSOGuqWs-XjpwLyJBwKDlb-YdUY,1136
|
|
17
|
+
actions/pre_commit/conformalize_repo/lib.py,sha256=ur2gDK3MwB5Vnb6Zb33alXobgN55tQgECkjd9AfXpfU,50348
|
|
18
|
+
actions/pre_commit/conformalize_repo/settings.py,sha256=SDP34Ux75Db1MEsHpXx52bEJuqA03xKTYulJX1wvl4g,5338
|
|
21
19
|
actions/pre_commit/constants.py,sha256=NBJ5GBMg5qhMAhAfxx1FKw0CdPwW_wG2cUJJ0dkF5HE,158
|
|
22
20
|
actions/pre_commit/format_requirements/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
23
21
|
actions/pre_commit/format_requirements/cli.py,sha256=c9UdOFDLEei5AEzrVvo6FopIEOf2EqyOliA-bOR5a2o,584
|
|
@@ -39,8 +37,8 @@ actions/pre_commit/update_requirements/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFB
|
|
|
39
37
|
actions/pre_commit/update_requirements/classes.py,sha256=ERC70c1CxQ3rOsQaEtp6FGbK_VaJ4K0jAV5XTB5-L30,3486
|
|
40
38
|
actions/pre_commit/update_requirements/cli.py,sha256=CBfm8M7hwSRw8KS6ttiNE86IFHJ52V42AxlfakqTDN0,584
|
|
41
39
|
actions/pre_commit/update_requirements/constants.py,sha256=ve44_RYed_41ckgQNPkb08u7Y1cpLpzutGSL9FdGBF8,228
|
|
42
|
-
actions/pre_commit/update_requirements/lib.py,sha256=
|
|
43
|
-
actions/pre_commit/utilities.py,sha256=
|
|
40
|
+
actions/pre_commit/update_requirements/lib.py,sha256=Wh8Lq6s_YJv4sDoUUMB-HuP0Ysm9nHePX7_xZ81o7Pk,4590
|
|
41
|
+
actions/pre_commit/utilities.py,sha256=VLh2tC9NNI60Uwx-ze3uuqKgOJ1OvFCvzYjDWM5o0Js,11397
|
|
44
42
|
actions/publish_package/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
45
43
|
actions/publish_package/cli.py,sha256=nAPHCq67mxUb3yHepVGcoQ69qgaQahM1-cxdbHfxQg0,803
|
|
46
44
|
actions/publish_package/constants.py,sha256=C68ZCVL_jVlYdLGpOK6saZccWoFy5AmC_NMBIWYdYOE,209
|
|
@@ -62,8 +60,8 @@ actions/register_gitea_runner/settings.py,sha256=0UQm8M3qDiBE3jiE333M4FdLjikNAzp
|
|
|
62
60
|
actions/run_hooks/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
63
61
|
actions/run_hooks/cli.py,sha256=xKBw6iIlHpUlHl6-QWQLSL6KKVjnsihBeJ7h58Rl8P4,616
|
|
64
62
|
actions/run_hooks/constants.py,sha256=JRhDk08qbzo5C-zwHdXZV5ajvNSKh4GcOcBvOIY6IGU,172
|
|
65
|
-
actions/run_hooks/lib.py,sha256=
|
|
66
|
-
actions/run_hooks/settings.py,sha256=
|
|
63
|
+
actions/run_hooks/lib.py,sha256=_IXK6uzKpXyyky6D0oYLjXoRLHsbA1pvTk_bcdY26RU,3259
|
|
64
|
+
actions/run_hooks/settings.py,sha256=Cj6QVK6JspzOp6-1CaOENlXbg25kvgPXG4FKWgIiDgY,740
|
|
67
65
|
actions/setup_cronjob/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
68
66
|
actions/setup_cronjob/cli.py,sha256=l6t2WjCUprACV0rY8kHvpHLt3LgMI4q2XY4AEOiutkk,891
|
|
69
67
|
actions/setup_cronjob/configs/cron.tmpl,sha256=UD_d0LYlB6tbkXAcUTzpGDWVNgIhCR45Jgky91iSCP8,412
|
|
@@ -76,9 +74,9 @@ actions/tag_commit/cli.py,sha256=1E6cM0XKTCt_Ukb7pxqOojHpJjoa63dVBO6DXoESe9Q,745
|
|
|
76
74
|
actions/tag_commit/constants.py,sha256=ceOvQpY4dgtJSd7v_jI1V00S0SjRq2ToGeZu41-DL7M,176
|
|
77
75
|
actions/tag_commit/lib.py,sha256=rq1SqAkNp98cPsNOsFY4F1D6nNi7N3wqVbFPno8lsuI,1849
|
|
78
76
|
actions/tag_commit/settings.py,sha256=TOeKG_GODP--2lBSyGzH_M32jDIfh4vk_Ts06R3_ak4,629
|
|
79
|
-
actions/types.py,sha256=
|
|
77
|
+
actions/types.py,sha256=1P3oAnYxyKgAfv8986jZ6whwdHV0qLHoX0oR8brviQk,586
|
|
80
78
|
actions/utilities.py,sha256=VpFLBiAezgSRlm9dvnyPyQohreaV2Lv7cJ9HAxqZ4WI,4086
|
|
81
|
-
dycw_actions-0.
|
|
82
|
-
dycw_actions-0.
|
|
83
|
-
dycw_actions-0.
|
|
84
|
-
dycw_actions-0.
|
|
79
|
+
dycw_actions-0.8.4.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
|
|
80
|
+
dycw_actions-0.8.4.dist-info/entry_points.txt,sha256=2Uu7wAZOm0mmcsGBEsGB370HAWgVWECRFJ9rKgfC3-I,46
|
|
81
|
+
dycw_actions-0.8.4.dist-info/METADATA,sha256=GyCgKEL03OjKWo5XN-TLYvLBqNfsih61YIFlwZwvQW4,654
|
|
82
|
+
dycw_actions-0.8.4.dist-info/RECORD,,
|
actions/action_dicts/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
actions/action_dicts/lib.py
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import TYPE_CHECKING, Any
|
|
4
|
-
|
|
5
|
-
from actions.action_dicts.constants import GITHUB_TOKEN, PRERELEASE, RESOLUTION
|
|
6
|
-
from actions.publish_package.constants import PUBLISH_PACKAGE_DOCSTRING
|
|
7
|
-
from actions.random_sleep.constants import RANDOM_SLEEP_DOCSTRING
|
|
8
|
-
from actions.run_hooks.constants import RUN_HOOKS_DOCSTRING
|
|
9
|
-
from actions.tag_commit.constants import TAG_COMMIT_DOCSTRING
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
from actions.types import StrDict
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def run_action_pre_commit_dict(
|
|
16
|
-
*,
|
|
17
|
-
token: str = GITHUB_TOKEN,
|
|
18
|
-
submodules: str | None = None,
|
|
19
|
-
repos: Any | None = None,
|
|
20
|
-
hooks: Any | None = None,
|
|
21
|
-
sleep: int = 1,
|
|
22
|
-
gitea: bool = False,
|
|
23
|
-
) -> StrDict:
|
|
24
|
-
dict_: StrDict = {"token": token}
|
|
25
|
-
_add_item(dict_, "submodules", value=submodules)
|
|
26
|
-
_add_item(dict_, "repos", value=repos)
|
|
27
|
-
_add_item(dict_, "hooks", value=hooks)
|
|
28
|
-
dict_["sleep"] = sleep
|
|
29
|
-
return {
|
|
30
|
-
"if": f"{_runner(gitea=gitea)}.event_name == 'pull_request'",
|
|
31
|
-
"name": RUN_HOOKS_DOCSTRING,
|
|
32
|
-
"uses": "dycw/action-run-hooks@latest",
|
|
33
|
-
"with": dict_,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def run_action_publish_dict(
|
|
38
|
-
*,
|
|
39
|
-
token: str = GITHUB_TOKEN,
|
|
40
|
-
username: str | None = None,
|
|
41
|
-
password: str | None = None,
|
|
42
|
-
publish_url: str | None = None,
|
|
43
|
-
trusted_publishing: bool = False,
|
|
44
|
-
native_tls: bool = False,
|
|
45
|
-
) -> StrDict:
|
|
46
|
-
dict_: StrDict = {"token": token}
|
|
47
|
-
_add_item(dict_, "username", value=username)
|
|
48
|
-
_add_item(dict_, "password", value=password)
|
|
49
|
-
_add_item(dict_, "publish-url", value=publish_url)
|
|
50
|
-
_add_boolean(dict_, "trusted-publishing", value=trusted_publishing)
|
|
51
|
-
_add_native_tls(dict_, native_tls=native_tls)
|
|
52
|
-
return {
|
|
53
|
-
"name": PUBLISH_PACKAGE_DOCSTRING,
|
|
54
|
-
"uses": "dycw/action-publish-package@latest",
|
|
55
|
-
"with": dict_,
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def run_action_pyright_dict(
|
|
60
|
-
*,
|
|
61
|
-
token: str = GITHUB_TOKEN,
|
|
62
|
-
python_version: str | None = None,
|
|
63
|
-
resolution: str = RESOLUTION,
|
|
64
|
-
prerelease: str = PRERELEASE,
|
|
65
|
-
native_tls: bool = False,
|
|
66
|
-
with_requirements: str | None = None,
|
|
67
|
-
) -> StrDict:
|
|
68
|
-
dict_: StrDict = {"token": token}
|
|
69
|
-
_add_python_version(dict_, python_version=python_version)
|
|
70
|
-
dict_["resolution"] = resolution
|
|
71
|
-
dict_["prerelease"] = prerelease
|
|
72
|
-
_add_native_tls(dict_, native_tls=native_tls)
|
|
73
|
-
_add_with_requirements(dict_, with_requirements=with_requirements)
|
|
74
|
-
return {
|
|
75
|
-
"name": "Run 'pyright'",
|
|
76
|
-
"uses": "dycw/action-pyright@latest",
|
|
77
|
-
"with": dict_,
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def run_action_pytest_dict(
|
|
82
|
-
*,
|
|
83
|
-
token: str = GITHUB_TOKEN,
|
|
84
|
-
python_version: str | None = None,
|
|
85
|
-
sops_age_key: str | None = None,
|
|
86
|
-
resolution: str = RESOLUTION,
|
|
87
|
-
prerelease: str = PRERELEASE,
|
|
88
|
-
native_tls: bool = False,
|
|
89
|
-
with_requirements: str | None = None,
|
|
90
|
-
) -> StrDict:
|
|
91
|
-
dict_: StrDict = {"token": token}
|
|
92
|
-
_add_python_version(dict_, python_version=python_version)
|
|
93
|
-
_add_item(dict_, "sops-age-key", value=sops_age_key)
|
|
94
|
-
dict_["resolution"] = resolution
|
|
95
|
-
dict_["prerelease"] = prerelease
|
|
96
|
-
_add_native_tls(dict_, native_tls=native_tls)
|
|
97
|
-
_add_with_requirements(dict_, with_requirements=with_requirements)
|
|
98
|
-
return {"name": "Run 'pytest'", "uses": "dycw/action-pytest@latest", "with": dict_}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def run_action_random_sleep_dict(
|
|
102
|
-
*,
|
|
103
|
-
token: str = GITHUB_TOKEN,
|
|
104
|
-
min: int = 0, # noqa: A002
|
|
105
|
-
max: int = 3600, # noqa: A002
|
|
106
|
-
step: int = 1,
|
|
107
|
-
log_freq: int = 1,
|
|
108
|
-
) -> StrDict:
|
|
109
|
-
dict_: StrDict = {
|
|
110
|
-
"token": token,
|
|
111
|
-
"min": min,
|
|
112
|
-
"max": max,
|
|
113
|
-
"step": step,
|
|
114
|
-
"log-freq": log_freq,
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
"name": RANDOM_SLEEP_DOCSTRING,
|
|
118
|
-
"uses": "dycw/action-random-sleep@latest",
|
|
119
|
-
"with": dict_,
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
def run_action_ruff_dict(*, token: str = GITHUB_TOKEN) -> StrDict:
|
|
124
|
-
dict_: StrDict = {"token": token}
|
|
125
|
-
return {"name": "Run 'ruff'", "uses": "dycw/action-ruff@latest", "with": dict_}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def run_action_tag_dict(
|
|
129
|
-
*,
|
|
130
|
-
token: str = GITHUB_TOKEN,
|
|
131
|
-
user_name: str = "github-actions-bot",
|
|
132
|
-
user_email: str = "noreply@github.com",
|
|
133
|
-
major_minor: bool = False,
|
|
134
|
-
major: bool = False,
|
|
135
|
-
latest: bool = False,
|
|
136
|
-
) -> StrDict:
|
|
137
|
-
dict_: StrDict = {"token": token, "user-name": user_name, "user-email": user_email}
|
|
138
|
-
_add_boolean(dict_, "major-minor", value=major_minor)
|
|
139
|
-
_add_boolean(dict_, "major", value=major)
|
|
140
|
-
_add_boolean(dict_, "latest", value=latest)
|
|
141
|
-
return {
|
|
142
|
-
"name": TAG_COMMIT_DOCSTRING,
|
|
143
|
-
"uses": "dycw/action-tag-commit@latest",
|
|
144
|
-
"with": dict_,
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
def _add_boolean(dict_: StrDict, key: str, /, *, value: bool = False) -> None:
|
|
149
|
-
if value:
|
|
150
|
-
dict_[key] = value
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
def _add_item(dict_: StrDict, key: str, /, *, value: Any | None = None) -> None:
|
|
154
|
-
if value is not None:
|
|
155
|
-
dict_[key] = value
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def _add_native_tls(dict_: StrDict, /, *, native_tls: bool = False) -> None:
|
|
159
|
-
_add_boolean(dict_, "native-tls", value=native_tls)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
def _add_python_version(
|
|
163
|
-
dict_: StrDict, /, *, python_version: str | None = None
|
|
164
|
-
) -> None:
|
|
165
|
-
_add_item(dict_, "python-version", value=python_version)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def _add_with_requirements(
|
|
169
|
-
dict_: StrDict, /, *, with_requirements: str | None = None
|
|
170
|
-
) -> None:
|
|
171
|
-
_add_item(dict_, "with-requirements", value=with_requirements)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def _runner(*, gitea: bool = False) -> str:
|
|
175
|
-
return "gitea" if gitea else "github"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
__all__ = [
|
|
179
|
-
"run_action_pre_commit_dict",
|
|
180
|
-
"run_action_publish_dict",
|
|
181
|
-
"run_action_pyright_dict",
|
|
182
|
-
"run_action_pytest_dict",
|
|
183
|
-
"run_action_random_sleep_dict",
|
|
184
|
-
"run_action_ruff_dict",
|
|
185
|
-
"run_action_tag_dict",
|
|
186
|
-
]
|
|
File without changes
|
|
File without changes
|