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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Crackerjack
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Crackerjack code style
5
5
  Keywords: black ruff mypy creosote refurb
6
6
  Home-page: https://github.com/lesleslie/crackerjack
@@ -1,8 +1,7 @@
1
1
  import asyncio
2
2
  import sys
3
3
  import typing as t
4
- from subprocess import call
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([Commands.git, "add", config, ""])
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 = call([Commands.pre_commit, "run", hook.lower(), "--all-files"])
84
- if fail > 0:
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 = check_output(
95
- [commands.pdm, "list", "--freeze"],
96
- universal_newlines=True,
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
- check_output([commands.pdm, "bump", options.publish])
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 = call([commands.pre_commit, "run", "--all-files"])
131
- if check_all > 0:
132
- call([commands.pre_commit, "run", "--all-files"])
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
- call(
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
- call([commands.git, "push", "origin", "main"])
148
+ run([commands.git, "push", "origin", "main"])
149
149
  await aprint("\nCrackerjack complete!\n")
150
150
 
151
151
 
@@ -61,7 +61,7 @@ pythonVersion = "3.11"
61
61
 
62
62
  [project]
63
63
  name = "Crackerjack"
64
- version = "0.6.0"
64
+ version = "0.6.2"
65
65
  description = "Crackerjack code style"
66
66
  requires-python = ">=3.11"
67
67
  readme = "README.md"
@@ -61,7 +61,7 @@ pythonVersion = "3.11"
61
61
 
62
62
  [project]
63
63
  name = "Crackerjack"
64
- version = "0.6.0"
64
+ version = "0.6.2"
65
65
  description = "Crackerjack code style"
66
66
  requires-python = ">=3.11"
67
67
  readme = "README.md"
File without changes
File without changes