crackerjack 0.19.8__py3-none-any.whl → 0.20.1__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/.gitignore CHANGED
@@ -12,3 +12,5 @@
12
12
  /*.pyc
13
13
  /scratch/
14
14
  /.zencoder/
15
+
16
+ **/.claude/settings.local.json
@@ -34,7 +34,7 @@ repos:
34
34
  - keyring
35
35
 
36
36
  - repo: https://github.com/astral-sh/uv-pre-commit
37
- rev: 0.7.10
37
+ rev: 0.7.12
38
38
  hooks:
39
39
  - id: uv-lock
40
40
  files: ^pyproject\.toml$
@@ -55,7 +55,7 @@ repos:
55
55
  - tomli
56
56
 
57
57
  - repo: https://github.com/astral-sh/ruff-pre-commit
58
- rev: v0.11.12
58
+ rev: v0.11.13
59
59
  hooks:
60
60
  - id: ruff-check
61
61
  - id: ruff-format
crackerjack/__init__.py CHANGED
@@ -1,5 +1,42 @@
1
1
  import typing as t
2
2
 
3
3
  from .crackerjack import Crackerjack, create_crackerjack_runner
4
+ from .errors import (
5
+ CleaningError,
6
+ ConfigError,
7
+ CrackerjackError,
8
+ ErrorCode,
9
+ ExecutionError,
10
+ FileError,
11
+ GitError,
12
+ PublishError,
13
+ TestError,
14
+ check_command_result,
15
+ check_file_exists,
16
+ handle_error,
17
+ )
4
18
 
5
- __all__: t.Sequence[str] = ["create_crackerjack_runner", "Crackerjack"]
19
+ try:
20
+ from importlib.metadata import version
21
+
22
+ __version__ = version("crackerjack")
23
+ except (ImportError, ModuleNotFoundError):
24
+ __version__ = "0.19.8"
25
+
26
+ __all__: t.Sequence[str] = [
27
+ "create_crackerjack_runner",
28
+ "Crackerjack",
29
+ "__version__",
30
+ "CrackerjackError",
31
+ "ConfigError",
32
+ "ExecutionError",
33
+ "TestError",
34
+ "PublishError",
35
+ "GitError",
36
+ "FileError",
37
+ "CleaningError",
38
+ "ErrorCode",
39
+ "handle_error",
40
+ "check_file_exists",
41
+ "check_command_result",
42
+ ]
crackerjack/__main__.py CHANGED
@@ -34,10 +34,13 @@ class Options(BaseModel):
34
34
  benchmark: bool = False
35
35
  benchmark_regression: bool = False
36
36
  benchmark_regression_threshold: float = 5.0
37
+ test_workers: int = 0
38
+ test_timeout: int = 0
37
39
  all: BumpOption | None = None
38
40
  ai_agent: bool = False
39
41
  create_pr: bool = False
40
42
  skip_hooks: bool = False
43
+ rich_ui: bool = False
41
44
 
42
45
  @classmethod
43
46
  @field_validator("publish", "bump", mode="before")
@@ -84,7 +87,7 @@ cli_options = {
84
87
  False,
85
88
  "-x",
86
89
  "--clean",
87
- help="Remove docstrings, line comments, and unnecessary whitespace.",
90
+ help="Remove docstrings, line comments, and unnecessary whitespace from source code (doesn't affect test files).",
88
91
  ),
89
92
  "test": typer.Option(False, "-t", "--test", help="Run tests."),
90
93
  "benchmark": typer.Option(
@@ -102,6 +105,16 @@ cli_options = {
102
105
  "--benchmark-regression-threshold",
103
106
  help="Maximum allowed performance regression percentage (default: 5.0%).",
104
107
  ),
108
+ "test_workers": typer.Option(
109
+ 0,
110
+ "--test-workers",
111
+ help="Number of parallel workers for running tests (0 = auto-detect, 1 = disable parallelization).",
112
+ ),
113
+ "test_timeout": typer.Option(
114
+ 0,
115
+ "--test-timeout",
116
+ help="Timeout in seconds for individual tests (0 = use default based on project size).",
117
+ ),
105
118
  "skip_hooks": typer.Option(
106
119
  False,
107
120
  "-s",
@@ -121,6 +134,11 @@ cli_options = {
121
134
  "--pr",
122
135
  help="Create a pull request to the upstream repository.",
123
136
  ),
137
+ "rich_ui": typer.Option(
138
+ False,
139
+ "--rich-ui",
140
+ help="Use the interactive Rich UI for a better experience.",
141
+ ),
124
142
  "ai_agent": typer.Option(
125
143
  False,
126
144
  "--ai-agent",
@@ -148,8 +166,11 @@ def main(
148
166
  benchmark_regression_threshold: float = cli_options[
149
167
  "benchmark_regression_threshold"
150
168
  ],
169
+ test_workers: int = cli_options["test_workers"],
170
+ test_timeout: int = cli_options["test_timeout"],
151
171
  skip_hooks: bool = cli_options["skip_hooks"],
152
172
  create_pr: bool = cli_options["create_pr"],
173
+ rich_ui: bool = cli_options["rich_ui"],
153
174
  ai_agent: bool = cli_options["ai_agent"],
154
175
  ) -> None:
155
176
  options = Options(
@@ -166,10 +187,13 @@ def main(
166
187
  benchmark=benchmark,
167
188
  benchmark_regression=benchmark_regression,
168
189
  benchmark_regression_threshold=benchmark_regression_threshold,
190
+ test_workers=test_workers,
191
+ test_timeout=test_timeout,
169
192
  skip_hooks=skip_hooks,
170
193
  all=all,
171
194
  ai_agent=ai_agent,
172
195
  create_pr=create_pr,
196
+ rich_ui=rich_ui,
173
197
  )
174
198
 
175
199
  if ai_agent:
@@ -177,8 +201,20 @@ def main(
177
201
 
178
202
  os.environ["AI_AGENT"] = "1"
179
203
 
180
- runner = create_crackerjack_runner(console=console)
181
- runner.process(options)
204
+ if rich_ui:
205
+ from crackerjack.interactive import launch_interactive_cli
206
+
207
+ try:
208
+ from importlib.metadata import version
209
+
210
+ pkg_version = version("crackerjack")
211
+ except (ImportError, ModuleNotFoundError):
212
+ pkg_version = "0.19.8"
213
+
214
+ launch_interactive_cli(pkg_version)
215
+ else:
216
+ runner = create_crackerjack_runner(console=console)
217
+ runner.process(options)
182
218
 
183
219
 
184
220
  if __name__ == "__main__":