crackerjack 0.8.14__py3-none-any.whl → 0.8.16__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.
- crackerjack/.pre-commit-config.yaml +3 -3
- crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
- crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
- crackerjack/crackerjack.py +29 -22
- crackerjack/pyproject.toml +6 -4
- {crackerjack-0.8.14.dist-info → crackerjack-0.8.16.dist-info}/METADATA +4 -4
- {crackerjack-0.8.14.dist-info → crackerjack-0.8.16.dist-info}/RECORD +9 -8
- {crackerjack-0.8.14.dist-info → crackerjack-0.8.16.dist-info}/WHEEL +0 -0
- {crackerjack-0.8.14.dist-info → crackerjack-0.8.16.dist-info}/licenses/LICENSE +0 -0
@@ -17,7 +17,7 @@ repos:
|
|
17
17
|
- id: check-added-large-files
|
18
18
|
name: check-added-large-files
|
19
19
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
20
|
-
rev: v0.6.
|
20
|
+
rev: v0.6.2
|
21
21
|
hooks:
|
22
22
|
- id: ruff-format
|
23
23
|
- id: ruff
|
@@ -61,11 +61,11 @@ repos:
|
|
61
61
|
- id: bandit
|
62
62
|
args: ["-c", "pyproject.toml"]
|
63
63
|
- repo: https://github.com/RobertCraigie/pyright-python
|
64
|
-
rev: v1.1.
|
64
|
+
rev: v1.1.377
|
65
65
|
hooks:
|
66
66
|
- id: pyright
|
67
67
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
68
|
-
rev: v0.6.
|
68
|
+
rev: v0.6.2
|
69
69
|
hooks:
|
70
70
|
- id: ruff
|
71
71
|
- id: ruff-format
|
Binary file
|
Binary file
|
crackerjack/crackerjack.py
CHANGED
@@ -3,7 +3,7 @@ import re
|
|
3
3
|
import sys
|
4
4
|
import typing as t
|
5
5
|
from pathlib import Path
|
6
|
-
from subprocess import run as
|
6
|
+
from subprocess import run as execute
|
7
7
|
|
8
8
|
from acb.actions.encode import dump, load
|
9
9
|
from aioconsole import ainput, aprint
|
@@ -17,7 +17,7 @@ class Config(BaseModel):
|
|
17
17
|
pre_commit_path: t.Optional[Path] = None
|
18
18
|
git_path: t.Optional[Path] = None
|
19
19
|
pdm_path: t.Optional[Path] = None
|
20
|
-
|
20
|
+
zsh_path: t.Optional[Path] = None
|
21
21
|
|
22
22
|
|
23
23
|
class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
@@ -90,12 +90,12 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
90
90
|
"crackerjack", self.pkg_name
|
91
91
|
)
|
92
92
|
)
|
93
|
-
|
93
|
+
execute([str(self.config.git_path), "add", config])
|
94
94
|
|
95
95
|
async def run_interactive(self, hook: str) -> None:
|
96
96
|
success: bool = False
|
97
97
|
while not success:
|
98
|
-
fail =
|
98
|
+
fail = execute(
|
99
99
|
[str(self.config.pre_commit_path), "run", hook.lower(), "--all-files"]
|
100
100
|
)
|
101
101
|
if fail.returncode > 0:
|
@@ -108,21 +108,21 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
108
108
|
|
109
109
|
async def update_pkg_configs(self) -> None:
|
110
110
|
await self.copy_configs()
|
111
|
-
installed_pkgs =
|
111
|
+
installed_pkgs = execute(
|
112
112
|
[str(self.config.pdm_path), "list", "--freeze"],
|
113
113
|
capture_output=True,
|
114
114
|
text=True,
|
115
115
|
).stdout.splitlines()
|
116
116
|
if not len([pkg for pkg in installed_pkgs if "pre-commit" in pkg]):
|
117
117
|
print('Installing "pre-commit"...')
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
118
|
+
execute([str(self.config.pdm_path), "self", "add", "keyring"])
|
119
|
+
execute([str(self.config.pdm_path), "config", "python.use_venv", "false"])
|
120
|
+
execute([str(self.config.git_path), "init"])
|
121
|
+
execute([str(self.config.git_path), "branch", "-m", "main"])
|
122
|
+
execute([str(self.config.git_path), "add", "pyproject.toml"])
|
123
|
+
execute([str(self.config.git_path), "add", "pdm.lock"])
|
124
|
+
execute([str(self.config.pre_commit_path), "install"])
|
125
|
+
execute(
|
126
126
|
[str(self.config.git_path), "config", "advice.addIgnoredFile", "false"]
|
127
127
|
)
|
128
128
|
await self.update_pyproject_configs()
|
@@ -137,15 +137,16 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
137
137
|
raise SystemExit("\nPlease configure '.crackerjack.yaml' and try again\n")
|
138
138
|
|
139
139
|
async def run_pre_commit(self) -> None:
|
140
|
-
check_all =
|
140
|
+
check_all = execute([str(self.config.pre_commit_path), "run", "--all-files"])
|
141
141
|
if check_all.returncode > 0:
|
142
|
-
check_all =
|
142
|
+
check_all = execute(
|
143
|
+
[str(self.config.pre_commit_path), "run", "--all-files"]
|
144
|
+
)
|
143
145
|
if check_all.returncode > 0:
|
144
146
|
await aprint("\n\nPre-commit failed. Please fix errors.\n")
|
145
147
|
raise SystemExit()
|
146
148
|
|
147
149
|
async def process(self, options: t.Any) -> None:
|
148
|
-
await self.load_config()
|
149
150
|
imp_dir = self.pkg_path / "__pypackages__" / self.config.python_version / "lib"
|
150
151
|
sys.path.append(str(imp_dir))
|
151
152
|
self.pkg_name = underscore(self.pkg_path.stem.lower())
|
@@ -154,22 +155,22 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
154
155
|
await aprint("\nCrackerjacking...\n")
|
155
156
|
if not options.do_not_update_configs:
|
156
157
|
await self.update_pkg_configs()
|
157
|
-
|
158
|
+
execute([str(self.config.pdm_path), "install"])
|
158
159
|
if self.pkg_path.stem == "crackerjack" and options.update_precommit:
|
159
|
-
|
160
|
+
execute([str(self.config.pre_commit_path), "autoupdate"])
|
160
161
|
if options.interactive:
|
161
162
|
for hook in ("refurb", "bandit", "pyright"):
|
162
163
|
await self.run_interactive(hook)
|
163
164
|
await self.run_pre_commit()
|
164
165
|
for option in (options.publish, options.bump):
|
165
166
|
if option:
|
166
|
-
|
167
|
+
execute([str(self.config.pdm_path), "bump", option])
|
167
168
|
break
|
168
169
|
if options.publish:
|
169
|
-
|
170
|
+
execute([str(self.config.pdm_path), "publish"])
|
170
171
|
if options.commit:
|
171
172
|
commit_msg = await ainput("\nCommit message: ")
|
172
|
-
|
173
|
+
execute(
|
173
174
|
[
|
174
175
|
str(self.config.git_path),
|
175
176
|
"commit",
|
@@ -180,10 +181,16 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
180
181
|
".",
|
181
182
|
]
|
182
183
|
)
|
183
|
-
|
184
|
+
execute([str(self.config.git_path), "push", "origin", "main"])
|
184
185
|
await aprint("\nCrackerjack complete!\n")
|
185
186
|
|
186
187
|
async def run(self, options: t.Any) -> None:
|
188
|
+
await self.load_config()
|
189
|
+
execute(
|
190
|
+
'eval "$(pdm --pep582)"',
|
191
|
+
shell=True, # noqa
|
192
|
+
executable=str(self.config.zsh_path),
|
193
|
+
)
|
187
194
|
process = asyncio.create_task(self.process(options))
|
188
195
|
await process
|
189
196
|
|
crackerjack/pyproject.toml
CHANGED
@@ -73,7 +73,9 @@ skips = [
|
|
73
73
|
"B311",
|
74
74
|
"B403",
|
75
75
|
"B404",
|
76
|
+
"B602",
|
76
77
|
"B603",
|
78
|
+
"B607",
|
77
79
|
]
|
78
80
|
|
79
81
|
[tool.pyright]
|
@@ -100,7 +102,7 @@ pythonPlatform = "Darwin"
|
|
100
102
|
|
101
103
|
[project]
|
102
104
|
name = "Crackerjack"
|
103
|
-
version = "0.8.
|
105
|
+
version = "0.8.15"
|
104
106
|
description = "Crackerjack code style"
|
105
107
|
requires-python = ">=3.12"
|
106
108
|
readme = "README.md"
|
@@ -113,7 +115,7 @@ keywords = [
|
|
113
115
|
]
|
114
116
|
classifiers = [
|
115
117
|
"Environment :: Console",
|
116
|
-
"Operating System ::
|
118
|
+
"Operating System :: POSIX",
|
117
119
|
"Programming Language :: Python",
|
118
120
|
"Programming Language :: Python :: 3.12",
|
119
121
|
"Development Status :: 4 - Beta",
|
@@ -134,8 +136,8 @@ dependencies = [
|
|
134
136
|
"pytest>=8.3.2",
|
135
137
|
"pydantic>=2.8.2",
|
136
138
|
"aiopath>=0.7.7",
|
137
|
-
"acb>=0.6.
|
138
|
-
"pdm-bump>=0.9.
|
139
|
+
"acb>=0.6.21",
|
140
|
+
"pdm-bump>=0.9.8",
|
139
141
|
"pdm>=2.18.1",
|
140
142
|
]
|
141
143
|
authors = [
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: Crackerjack
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.16
|
4
4
|
Summary: Crackerjack code style
|
5
5
|
Keywords: black,ruff,mypy,creosote,refurb
|
6
6
|
Home-page: https://github.com/lesleslie/crackerjack
|
@@ -8,7 +8,7 @@ Author-Email: lesleslie <les@wedgwoodwebworks.com>
|
|
8
8
|
Maintainer-Email: lesleslie <les@wedgwoodwebworks.com>
|
9
9
|
License: BSD-3-Clause
|
10
10
|
Classifier: Environment :: Console
|
11
|
-
Classifier: Operating System ::
|
11
|
+
Classifier: Operating System :: POSIX
|
12
12
|
Classifier: Programming Language :: Python
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
14
14
|
Classifier: Development Status :: 4 - Beta
|
@@ -31,8 +31,8 @@ Requires-Dist: pre-commit>=3.8.0
|
|
31
31
|
Requires-Dist: pytest>=8.3.2
|
32
32
|
Requires-Dist: pydantic>=2.8.2
|
33
33
|
Requires-Dist: aiopath>=0.7.7
|
34
|
-
Requires-Dist: acb>=0.6.
|
35
|
-
Requires-Dist: pdm-bump>=0.9.
|
34
|
+
Requires-Dist: acb>=0.6.21
|
35
|
+
Requires-Dist: pdm-bump>=0.9.8
|
36
36
|
Requires-Dist: pdm>=2.18.1
|
37
37
|
Description-Content-Type: text/markdown
|
38
38
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
crackerjack-0.8.
|
2
|
-
crackerjack-0.8.
|
3
|
-
crackerjack-0.8.
|
1
|
+
crackerjack-0.8.16.dist-info/METADATA,sha256=3Bc9ZUNIML9ticVSiGwt2Nj6Ew7MDLXaDfLhDO6DLeM,7753
|
2
|
+
crackerjack-0.8.16.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
|
3
|
+
crackerjack-0.8.16.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
4
4
|
crackerjack/.gitignore,sha256=7qePRaD8q-U6oV3gvgAcwFF8GudcRGAWf-Z-0IDqMaE,207
|
5
5
|
crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
|
6
|
-
crackerjack/.pre-commit-config.yaml,sha256=
|
6
|
+
crackerjack/.pre-commit-config.yaml,sha256=VVvLtm3C_KKh_Jyi2kSSnCF18ny6-M2kDzbI9sakeCA,2167
|
7
7
|
crackerjack/.ruff_cache/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
8
8
|
crackerjack/.ruff_cache/0.1.11/3256171999636029978,sha256=-RLDsRf5uj09SyFQVzjwQ1HkTxjIRxNLLE24SEJxD4g,248
|
9
9
|
crackerjack/.ruff_cache/0.1.14/602324811142551221,sha256=HIYvldb69IHdMzquAA8JpzU2RDT9shEB_dPvzyeFZ_g,248
|
@@ -22,10 +22,11 @@ crackerjack/.ruff_cache/0.5.7/1493622539551733492,sha256=pSocPQAUIr0jKWiGFCL-guo
|
|
22
22
|
crackerjack/.ruff_cache/0.5.7/6231957614044513175,sha256=cpMwivWK0bqQ1V4WO_D1Q-aZarbhf-r4sk4Po8oXZc4,224
|
23
23
|
crackerjack/.ruff_cache/0.5.7/9932762556785938009,sha256=OrAu-VJZI4ctEycJEplrzI2qXzgaxE5TPvj6IFVQSdw,224
|
24
24
|
crackerjack/.ruff_cache/0.6.0/11982804814124138945,sha256=2lznSj8cCUgunSBia8roQ-Cj5TBFiSoe0wIl7cDAiY8,224
|
25
|
-
crackerjack/.ruff_cache/0.6.0/12055761203849489982,sha256=
|
25
|
+
crackerjack/.ruff_cache/0.6.0/12055761203849489982,sha256=mGzYAukLYQmayZDp4bfHzWpif-GH48e9xi-CMcQDPrM,224
|
26
|
+
crackerjack/.ruff_cache/0.6.2/1206147804896221174,sha256=Pk8jauJiK81gV1Ox8gp-oUnAsGC2pn_zgOfhPnkM_Yk,224
|
26
27
|
crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
|
27
28
|
crackerjack/__init__.py,sha256=AuglbbJHkUJ2GdvyT0ca35ntexo1RkT2V6DgypoFeEk,121
|
28
29
|
crackerjack/__main__.py,sha256=W0KSo35_rmj_p4Zr2Q6FAvojiiPTmh5kjlggVNcOdac,1766
|
29
|
-
crackerjack/crackerjack.py,sha256=
|
30
|
-
crackerjack/pyproject.toml,sha256=
|
31
|
-
crackerjack-0.8.
|
30
|
+
crackerjack/crackerjack.py,sha256=aoknG7btKND58d0Gb1Hde02NME7J64r7wvwV2TmxZDo,8440
|
31
|
+
crackerjack/pyproject.toml,sha256=zA18F8pFa7z9TRIIsLPtk-HyllJJTriuSuOXEMkQ444,2973
|
32
|
+
crackerjack-0.8.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|