crackerjack 0.6.0__tar.gz → 0.6.2__tar.gz
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.
- {crackerjack-0.6.0 → crackerjack-0.6.2}/PKG-INFO +1 -1
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/crackerjack.py +18 -18
- {crackerjack-0.6.0 → crackerjack-0.6.2/crackerjack}/pyproject.toml +1 -1
- {crackerjack-0.6.0/crackerjack → crackerjack-0.6.2}/pyproject.toml +1 -1
- {crackerjack-0.6.0 → crackerjack-0.6.2}/LICENSE +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/README.md +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/.gitignore +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/.libcst.codemod.yaml +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/.pre-commit-config.yaml +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/.ruff_cache/.gitignore +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/__init__.py +0 -0
- {crackerjack-0.6.0 → crackerjack-0.6.2}/crackerjack/__main__.py +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import sys
|
|
3
3
|
import typing as t
|
|
4
|
-
from
|
|
5
|
-
from subprocess import check_output
|
|
4
|
+
from shlex import quote as shlex_quote
|
|
6
5
|
from subprocess import run
|
|
7
6
|
|
|
8
7
|
from acb.actions import dump
|
|
@@ -74,14 +73,17 @@ class Crakerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
74
73
|
await pkg_config_path.write_text(
|
|
75
74
|
config_text.replace("crackerjack", self.pkg_name)
|
|
76
75
|
)
|
|
77
|
-
run([
|
|
76
|
+
run([commands.git, "add", config, ""])
|
|
78
77
|
|
|
79
78
|
@staticmethod
|
|
80
79
|
def run_interactive(hook: str) -> None:
|
|
81
80
|
success: bool = False
|
|
82
81
|
while not success:
|
|
83
|
-
fail =
|
|
84
|
-
|
|
82
|
+
fail = run(
|
|
83
|
+
[commands.pre_commit, "run", hook.lower(), "--all-files"],
|
|
84
|
+
capture_output=True,
|
|
85
|
+
)
|
|
86
|
+
if fail.returncode > 0:
|
|
85
87
|
retry = input(f"\n\n{hook.title()} failed. Retry? (y/N): ")
|
|
86
88
|
print()
|
|
87
89
|
if retry.strip().lower() == "y":
|
|
@@ -91,10 +93,9 @@ class Crakerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
91
93
|
|
|
92
94
|
async def update_pkg_configs(self) -> None:
|
|
93
95
|
await self.copy_configs()
|
|
94
|
-
installed_pkgs =
|
|
95
|
-
[commands.pdm, "list", "--freeze"],
|
|
96
|
-
|
|
97
|
-
).splitlines()
|
|
96
|
+
installed_pkgs = run(
|
|
97
|
+
[commands.pdm, "list", "--freeze"], capture_output=True, text=True
|
|
98
|
+
).stdout.splitlines()
|
|
98
99
|
if not len([pkg for pkg in installed_pkgs if "pre-commit" in pkg]):
|
|
99
100
|
run([commands.pdm, "self", "add", "keyring"])
|
|
100
101
|
run([commands.pdm, "config", "python.use_venv", "false"])
|
|
@@ -104,7 +105,6 @@ class Crakerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
104
105
|
run([commands.pdm, "add", "-d", "pre_commit"])
|
|
105
106
|
run([commands.pdm, "add", "-d", "pytest"])
|
|
106
107
|
run([commands.pdm, "add", "-d", "autotyping"])
|
|
107
|
-
run([commands.pdm, "add", "-d", "pyright"])
|
|
108
108
|
run([commands.pre_commit, "install"])
|
|
109
109
|
run([commands.git, "add", "pdm.lock"])
|
|
110
110
|
run([commands.git, "config", "advice.addIgnoredFile", "false"])
|
|
@@ -121,31 +121,31 @@ class Crakerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
121
121
|
run([commands.pre_commit, "autoupdate"])
|
|
122
122
|
await asyncio.create_subprocess_shell('eval "$(pdm --pep582)"')
|
|
123
123
|
if options.publish:
|
|
124
|
-
|
|
124
|
+
run([commands.pdm, "bump", options.publish])
|
|
125
125
|
if not options.do_not_update_configs:
|
|
126
126
|
await self.update_pkg_configs()
|
|
127
127
|
if options.interactive:
|
|
128
128
|
for hook in ("refurb", "pyright"):
|
|
129
129
|
self.run_interactive(hook)
|
|
130
|
-
check_all =
|
|
131
|
-
if check_all > 0:
|
|
132
|
-
|
|
130
|
+
check_all = run([commands.pre_commit, "run", "--all-files"])
|
|
131
|
+
if check_all.returncode > 0:
|
|
132
|
+
run([commands.pre_commit, "run", "--all-files"])
|
|
133
133
|
if options.publish:
|
|
134
134
|
run([commands.pdm, "publish"])
|
|
135
135
|
if options.commit:
|
|
136
136
|
commit_msg = await ainput("Commit message: ")
|
|
137
|
-
|
|
137
|
+
run(
|
|
138
138
|
[
|
|
139
|
-
commands.git,
|
|
139
|
+
shlex_quote(commands.git),
|
|
140
140
|
"commit",
|
|
141
141
|
"-m",
|
|
142
142
|
f"{commit_msg}",
|
|
143
143
|
"--no-verify",
|
|
144
144
|
"--",
|
|
145
145
|
".",
|
|
146
|
-
]
|
|
146
|
+
],
|
|
147
147
|
)
|
|
148
|
-
|
|
148
|
+
run([commands.git, "push", "origin", "main"])
|
|
149
149
|
await aprint("\nCrackerjack complete!\n")
|
|
150
150
|
|
|
151
151
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|