crackerjack 0.8.13__py3-none-any.whl → 0.8.15__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.
@@ -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 shell
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
- zshenv_path: t.Optional[Path] = None
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
- shell([str(self.config.git_path), "add", config])
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 = shell(
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 = shell(
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
- shell([str(self.config.pdm_path), "self", "add", "keyring"])
119
- shell([str(self.config.pdm_path), "config", "python.use_venv", "false"])
120
- shell([str(self.config.git_path), "init"])
121
- shell([str(self.config.git_path), "branch", "-m", "main"])
122
- shell([str(self.config.git_path), "add", "pyproject.toml"])
123
- shell([str(self.config.git_path), "add", "pdm.lock"])
124
- shell([str(self.config.pre_commit_path), "install"])
125
- shell(
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 = shell([str(self.config.pre_commit_path), "run", "--all-files"])
140
+ check_all = execute([str(self.config.pre_commit_path), "run", "--all-files"])
141
141
  if check_all.returncode > 0:
142
- check_all = shell([str(self.config.pre_commit_path), "run", "--all-files"])
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
- shell([str(self.config.pdm_path), "install"])
158
+ execute([str(self.config.pdm_path), "install"])
158
159
  if self.pkg_path.stem == "crackerjack" and options.update_precommit:
159
- shell([str(self.config.pre_commit_path), "autoupdate"])
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
- shell([str(self.config.pdm_path), "bump", option])
167
+ execute([str(self.config.pdm_path), "bump", option])
167
168
  break
168
169
  if options.publish:
169
- shell([str(self.config.pdm_path), "publish"])
170
+ execute([str(self.config.pdm_path), "publish"])
170
171
  if options.commit:
171
172
  commit_msg = await ainput("\nCommit message: ")
172
- shell(
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
- shell([str(self.config.git_path), "push", "origin", "main"])
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
 
@@ -57,6 +57,8 @@ exclude-deps = [
57
57
  "pre-commit",
58
58
  "pytest",
59
59
  "pdm",
60
+ "pyfiglet",
61
+ "pyyaml",
60
62
  ]
61
63
 
62
64
  [tool.refurb]
@@ -71,7 +73,9 @@ skips = [
71
73
  "B311",
72
74
  "B403",
73
75
  "B404",
76
+ "B602",
74
77
  "B603",
78
+ "B607",
75
79
  ]
76
80
 
77
81
  [tool.pyright]
@@ -98,7 +102,7 @@ pythonPlatform = "Darwin"
98
102
 
99
103
  [project]
100
104
  name = "Crackerjack"
101
- version = "0.8.12"
105
+ version = "0.8.14"
102
106
  description = "Crackerjack code style"
103
107
  requires-python = ">=3.12"
104
108
  readme = "README.md"
@@ -111,7 +115,7 @@ keywords = [
111
115
  ]
112
116
  classifiers = [
113
117
  "Environment :: Console",
114
- "Operating System :: OS Independent",
118
+ "Operating System :: POSIX",
115
119
  "Programming Language :: Python",
116
120
  "Programming Language :: Python :: 3.12",
117
121
  "Development Status :: 4 - Beta",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Crackerjack
3
- Version: 0.8.13
3
+ Version: 0.8.15
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 :: OS Independent
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
@@ -1,6 +1,6 @@
1
- crackerjack-0.8.13.dist-info/METADATA,sha256=ZW7A7UKC_No5QNnxiI8rRwPqQerpNGYp0RPQHOniwmU,7762
2
- crackerjack-0.8.13.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
- crackerjack-0.8.13.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
1
+ crackerjack-0.8.15.dist-info/METADATA,sha256=5Hvu4l7ktEF5l6sF9VM256Thmrntp2HCvian13i9EcY,7753
2
+ crackerjack-0.8.15.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
+ crackerjack-0.8.15.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
6
  crackerjack/.pre-commit-config.yaml,sha256=GuSMQqO36mziS_UpHxsW6HA9udY0LIZLe8Ai2vMN5iQ,2167
@@ -22,10 +22,10 @@ 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=AevZgasE3KEhREvp-T9d5xyBYt7QnNIPelA8e4GTzNw,224
25
+ crackerjack/.ruff_cache/0.6.0/12055761203849489982,sha256=mGzYAukLYQmayZDp4bfHzWpif-GH48e9xi-CMcQDPrM,224
26
26
  crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
27
27
  crackerjack/__init__.py,sha256=AuglbbJHkUJ2GdvyT0ca35ntexo1RkT2V6DgypoFeEk,121
28
28
  crackerjack/__main__.py,sha256=W0KSo35_rmj_p4Zr2Q6FAvojiiPTmh5kjlggVNcOdac,1766
29
- crackerjack/crackerjack.py,sha256=Aqnn9ExIG8XLq0Sdv0gBdSzsROpYAUZdt2xwWf4ohAU,8226
30
- crackerjack/pyproject.toml,sha256=kUHrvPhmolNgUn3bLdXMasmTJs0_MmjSuoWz4g8H7-s,2928
31
- crackerjack-0.8.13.dist-info/RECORD,,
29
+ crackerjack/crackerjack.py,sha256=aoknG7btKND58d0Gb1Hde02NME7J64r7wvwV2TmxZDo,8440
30
+ crackerjack/pyproject.toml,sha256=e-QI18nH4YO72uF3b489H8-NoKv8-GBD6T8XRcZL4mc,2973
31
+ crackerjack-0.8.15.dist-info/RECORD,,