crackerjack 0.17.3__tar.gz → 0.18.0__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.17.3 → crackerjack-0.18.0}/PKG-INFO +1 -1
- crackerjack-0.18.0/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/__main__.py +9 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/crackerjack.py +10 -3
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/pyproject.toml +1 -1
- {crackerjack-0.17.3 → crackerjack-0.18.0}/pyproject.toml +1 -1
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/test_crackerjack.py +40 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/test_crackerjack_runner.py +23 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/test_main.py +17 -0
- crackerjack-0.17.3/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/LICENSE +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/README.md +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.gitignore +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.libcst.codemod.yaml +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pdm.toml +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pre-commit-config.yaml +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pytest_cache/.gitignore +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pytest_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pytest_cache/README.md +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pytest_cache/v/cache/nodeids +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.pytest_cache/v/cache/stepwise +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/.gitignore +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.11/3256171999636029978 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.14/602324811142551221 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.4/10355199064880463147 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.6/15140459877605758699 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.7/1790508110482614856 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.9/17041001205004563469 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.2/4070660268492669020 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.3/9818742842212983150 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.4/9818742842212983150 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.6/3557596832929915217 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.7/10386934055395314831 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.7/3557596832929915217 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.2.0/10047773857155985907 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.2.1/8522267973936635051 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.2.2/18053836298936336950 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.0/12548816621480535786 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.3/11081883392474770722 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.4/676973378459347183 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.5/16311176246009842383 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.5.7/1493622539551733492 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.5.7/6231957614044513175 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.5.7/9932762556785938009 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.0/11982804814124138945 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.4/1206147804896221174 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.5/1206147804896221174 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.7/3657366982708166874 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.9/285614542852677309 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.7.1/1024065805990144819 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.7.1/285614542852677309 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.7.3/16061516852537040135 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.8.4/16354268377385700367 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.10/923908772239632759 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.3/13948373885254993391 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.9/12813592349865671909 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.9/8843823720003377982 +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/__init__.py +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/README.md +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/__init__.py +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/data/comments_sample.txt +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/data/docstrings_sample.txt +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/data/expected_comments_sample.txt +0 -0
- {crackerjack-0.17.3 → crackerjack-0.18.0}/tests/data/init.py +0 -0
Binary file
|
@@ -34,6 +34,7 @@ class Options(BaseModel):
|
|
34
34
|
all: BumpOption | None = None
|
35
35
|
ai_agent: bool = False
|
36
36
|
create_pr: bool = False
|
37
|
+
skip_hooks: bool = False
|
37
38
|
|
38
39
|
@classmethod
|
39
40
|
@field_validator("publish", "bump", mode="before")
|
@@ -83,6 +84,12 @@ cli_options = {
|
|
83
84
|
help="Remove docstrings, line comments, and unnecessary whitespace.",
|
84
85
|
),
|
85
86
|
"test": typer.Option(False, "-t", "--test", help="Run tests."),
|
87
|
+
"skip_hooks": typer.Option(
|
88
|
+
False,
|
89
|
+
"-s",
|
90
|
+
"--skip-hooks",
|
91
|
+
help="Skip running pre-commit hooks (useful with -t).",
|
92
|
+
),
|
86
93
|
"all": typer.Option(
|
87
94
|
None,
|
88
95
|
"-a",
|
@@ -118,6 +125,7 @@ def main(
|
|
118
125
|
bump: BumpOption | None = cli_options["bump"],
|
119
126
|
clean: bool = cli_options["clean"],
|
120
127
|
test: bool = cli_options["test"],
|
128
|
+
skip_hooks: bool = cli_options["skip_hooks"],
|
121
129
|
create_pr: bool = cli_options["create_pr"],
|
122
130
|
ai_agent: bool = cli_options["ai_agent"],
|
123
131
|
) -> None:
|
@@ -132,6 +140,7 @@ def main(
|
|
132
140
|
bump=bump,
|
133
141
|
clean=clean,
|
134
142
|
test=test,
|
143
|
+
skip_hooks=skip_hooks,
|
135
144
|
all=all,
|
136
145
|
ai_agent=ai_agent,
|
137
146
|
create_pr=create_pr,
|
@@ -44,6 +44,7 @@ class OptionsProtocol(t.Protocol):
|
|
44
44
|
all: t.Any | None
|
45
45
|
ai_agent: bool = False
|
46
46
|
create_pr: bool = False
|
47
|
+
skip_hooks: bool = False
|
47
48
|
|
48
49
|
|
49
50
|
@dataclass
|
@@ -499,7 +500,7 @@ class Crackerjack:
|
|
499
500
|
"--no-header", # Reduce output noise
|
500
501
|
"--disable-warnings", # Disable warning capture
|
501
502
|
"--durations=0", # Show slowest tests to identify potential hanging tests
|
502
|
-
"--timeout=
|
503
|
+
"--timeout=60", # 1-minute timeout for tests
|
503
504
|
]
|
504
505
|
)
|
505
506
|
return test
|
@@ -796,8 +797,14 @@ class Crackerjack:
|
|
796
797
|
if options.clean:
|
797
798
|
actions_performed.append("clean_project")
|
798
799
|
|
799
|
-
|
800
|
-
|
800
|
+
if not options.skip_hooks:
|
801
|
+
self.project_manager.run_pre_commit()
|
802
|
+
actions_performed.append("run_pre_commit")
|
803
|
+
else:
|
804
|
+
self.console.print(
|
805
|
+
"\n[yellow]Skipping pre-commit hooks as requested[/yellow]\n"
|
806
|
+
)
|
807
|
+
actions_performed.append("skip_pre_commit")
|
801
808
|
|
802
809
|
self._run_tests(options)
|
803
810
|
if options.test:
|
@@ -40,6 +40,7 @@ class OptionsForTesting:
|
|
40
40
|
all: BumpOption | None = None
|
41
41
|
ai_agent: bool = False
|
42
42
|
create_pr: bool = False
|
43
|
+
skip_hooks: bool = False
|
43
44
|
|
44
45
|
|
45
46
|
@pytest.fixture
|
@@ -229,6 +230,45 @@ class TestCrackerjackProcess:
|
|
229
230
|
("Skipping config updates" in call for call in console_print_calls)
|
230
231
|
), "Expected 'Skipping config updates' message was not printed"
|
231
232
|
|
233
|
+
def test_process_with_skip_hooks_option(
|
234
|
+
self,
|
235
|
+
mock_execute: MagicMock,
|
236
|
+
mock_console_print: MagicMock,
|
237
|
+
mock_input: MagicMock,
|
238
|
+
mock_project_manager_execute: MagicMock,
|
239
|
+
mock_config_manager_execute: MagicMock,
|
240
|
+
tmp_path: Path,
|
241
|
+
tmp_path_package: Path,
|
242
|
+
create_package_dir: None,
|
243
|
+
options_factory: t.Callable[..., OptionsForTesting],
|
244
|
+
) -> None:
|
245
|
+
mock_execute.return_value.returncode = 0
|
246
|
+
mock_project_manager_execute.return_value.returncode = 0
|
247
|
+
mock_config_manager_execute.return_value.returncode = 0
|
248
|
+
options = options_factory(test=True, skip_hooks=True)
|
249
|
+
|
250
|
+
with (
|
251
|
+
patch.object(Crackerjack, "_run_tests") as mock_run_tests,
|
252
|
+
patch.object(ProjectManager, "run_pre_commit") as mock_run_pre_commit,
|
253
|
+
):
|
254
|
+
mock_run_tests.side_effect = lambda opts: mock_console_print(
|
255
|
+
"\n\nRunning tests...\n"
|
256
|
+
)
|
257
|
+
cj = Crackerjack(dry_run=True)
|
258
|
+
cj.process(options)
|
259
|
+
|
260
|
+
mock_run_pre_commit.assert_not_called()
|
261
|
+
|
262
|
+
mock_run_tests.assert_called_once_with(options)
|
263
|
+
|
264
|
+
console_print_calls = [str(call) for call in mock_console_print.call_args_list]
|
265
|
+
assert any(("Running tests" in call for call in console_print_calls)), (
|
266
|
+
"Expected 'Running tests' message was not printed"
|
267
|
+
)
|
268
|
+
assert any(
|
269
|
+
("Skipping pre-commit hooks" in call for call in console_print_calls)
|
270
|
+
), "Expected 'Skipping pre-commit hooks' message was not printed"
|
271
|
+
|
232
272
|
def test_process_with_bump_option(
|
233
273
|
self,
|
234
274
|
mock_execute: MagicMock,
|
@@ -24,6 +24,7 @@ class MockOptions:
|
|
24
24
|
self.all = kwargs.get("all")
|
25
25
|
self.ai_agent = kwargs.get("ai_agent", False)
|
26
26
|
self.create_pr = kwargs.get("create_pr", False)
|
27
|
+
self.skip_hooks = kwargs.get("skip_hooks", False)
|
27
28
|
|
28
29
|
|
29
30
|
def test_create_crackerjack_runner() -> None:
|
@@ -124,3 +125,25 @@ def test_process_with_test_option(
|
|
124
125
|
with patch("builtins.input", return_value="Test commit message"):
|
125
126
|
with patch.object(Crackerjack, "_run_tests"):
|
126
127
|
crackerjack.process(options)
|
128
|
+
|
129
|
+
|
130
|
+
def test_process_with_test_and_skip_hooks_options(
|
131
|
+
mock_crackerjack: tuple[Crackerjack, dict[str, MagicMock]],
|
132
|
+
) -> None:
|
133
|
+
crackerjack, mocks = mock_crackerjack
|
134
|
+
|
135
|
+
options = MockOptions(test=True, skip_hooks=True)
|
136
|
+
|
137
|
+
crackerjack.execute_command = MagicMock(
|
138
|
+
return_value=MagicMock(returncode=0, stdout="All tests passed", stderr="")
|
139
|
+
)
|
140
|
+
|
141
|
+
with patch("builtins.input", return_value="Test commit message"):
|
142
|
+
with patch.object(Crackerjack, "_run_tests"):
|
143
|
+
crackerjack.process(options)
|
144
|
+
|
145
|
+
mocks["project_manager"].run_pre_commit.assert_not_called()
|
146
|
+
|
147
|
+
mocks["console"].print.assert_any_call(
|
148
|
+
"\n[yellow]Skipping pre-commit hooks as requested[/yellow]\n"
|
149
|
+
)
|
@@ -223,6 +223,7 @@ def test_create_options() -> None:
|
|
223
223
|
test=True,
|
224
224
|
all=BumpOption.minor,
|
225
225
|
create_pr=True,
|
226
|
+
skip_hooks=True,
|
226
227
|
)
|
227
228
|
assert test_options.commit
|
228
229
|
assert test_options.interactive
|
@@ -236,6 +237,7 @@ def test_create_options() -> None:
|
|
236
237
|
assert test_options.test
|
237
238
|
assert test_options.all == BumpOption.minor
|
238
239
|
assert test_options.create_pr
|
240
|
+
assert test_options.skip_hooks
|
239
241
|
|
240
242
|
|
241
243
|
def test_conflicting_options(
|
@@ -296,3 +298,18 @@ def test_create_pr_option(
|
|
296
298
|
assert result.exit_code == 0
|
297
299
|
options = mock_crackerjack_process.process.call_args[0][0]
|
298
300
|
assert options.create_pr
|
301
|
+
|
302
|
+
|
303
|
+
def test_skip_hooks_option(
|
304
|
+
runner: CliRunner, mock_crackerjack_process: MagicMock
|
305
|
+
) -> None:
|
306
|
+
result = runner.invoke(app, ["-s"])
|
307
|
+
assert result.exit_code == 0
|
308
|
+
mock_crackerjack_process.process.assert_called_once()
|
309
|
+
options = mock_crackerjack_process.process.call_args[0][0]
|
310
|
+
assert options.skip_hooks
|
311
|
+
mock_crackerjack_process.process.reset_mock()
|
312
|
+
result = runner.invoke(app, ["--skip-hooks"])
|
313
|
+
assert result.exit_code == 0
|
314
|
+
options = mock_crackerjack_process.process.call_args[0][0]
|
315
|
+
assert options.skip_hooks
|
Binary file
|
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
|
File without changes
|
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.11/3256171999636029978
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.4/10355199064880463147
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.6/15140459877605758699
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.1.9/17041001205004563469
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.2/4070660268492669020
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.3/9818742842212983150
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.4/9818742842212983150
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.6/3557596832929915217
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.7/10386934055395314831
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.11.7/3557596832929915217
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.2.0/10047773857155985907
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.2.2/18053836298936336950
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.0/12548816621480535786
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.3/11081883392474770722
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.3.5/16311176246009842383
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.0/11982804814124138945
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.6.0/12055761203849489982
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.7.3/16061516852537040135
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.8.4/16354268377385700367
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.10/12813592349865671909
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.3/13948373885254993391
RENAMED
File without changes
|
{crackerjack-0.17.3 → crackerjack-0.18.0}/crackerjack/.ruff_cache/0.9.9/12813592349865671909
RENAMED
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
|
File without changes
|