crackerjack 0.18.10__tar.gz → 0.18.11__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.
Files changed (73) hide show
  1. {crackerjack-0.18.10 → crackerjack-0.18.11}/PKG-INFO +1 -1
  2. crackerjack-0.18.11/crackerjack/.ruff_cache/0.11.12/16869036553936192448 +0 -0
  3. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/__main__.py +8 -0
  4. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/crackerjack.py +4 -0
  5. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/pyproject.toml +1 -1
  6. {crackerjack-0.18.10 → crackerjack-0.18.11}/pyproject.toml +1 -1
  7. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/test_crackerjack.py +27 -0
  8. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/test_crackerjack_runner.py +1 -0
  9. crackerjack-0.18.11/tests/test_pytest_features.py +74 -0
  10. crackerjack-0.18.10/crackerjack/.ruff_cache/0.11.12/16869036553936192448 +0 -0
  11. crackerjack-0.18.10/tests/test_pytest_features.py +0 -41
  12. {crackerjack-0.18.10 → crackerjack-0.18.11}/LICENSE +0 -0
  13. {crackerjack-0.18.10 → crackerjack-0.18.11}/README.md +0 -0
  14. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.gitignore +0 -0
  15. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.libcst.codemod.yaml +0 -0
  16. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pdm.toml +0 -0
  17. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pre-commit-config.yaml +0 -0
  18. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pytest_cache/.gitignore +0 -0
  19. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pytest_cache/CACHEDIR.TAG +0 -0
  20. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pytest_cache/README.md +0 -0
  21. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pytest_cache/v/cache/nodeids +0 -0
  22. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.pytest_cache/v/cache/stepwise +0 -0
  23. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/.gitignore +0 -0
  24. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.11/3256171999636029978 +0 -0
  25. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.14/602324811142551221 +0 -0
  26. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.4/10355199064880463147 +0 -0
  27. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.6/15140459877605758699 +0 -0
  28. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.7/1790508110482614856 +0 -0
  29. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.1.9/17041001205004563469 +0 -0
  30. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.11/18187162184424859798 +0 -0
  31. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.2/4070660268492669020 +0 -0
  32. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.3/9818742842212983150 +0 -0
  33. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.4/9818742842212983150 +0 -0
  34. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.6/3557596832929915217 +0 -0
  35. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.7/10386934055395314831 +0 -0
  36. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.7/3557596832929915217 +0 -0
  37. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
  38. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.2.0/10047773857155985907 +0 -0
  39. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.2.1/8522267973936635051 +0 -0
  40. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.2.2/18053836298936336950 +0 -0
  41. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.3.0/12548816621480535786 +0 -0
  42. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.3.3/11081883392474770722 +0 -0
  43. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.3.4/676973378459347183 +0 -0
  44. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.3.5/16311176246009842383 +0 -0
  45. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.5.7/1493622539551733492 +0 -0
  46. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.5.7/6231957614044513175 +0 -0
  47. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.5.7/9932762556785938009 +0 -0
  48. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.0/11982804814124138945 +0 -0
  49. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
  50. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
  51. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.4/1206147804896221174 +0 -0
  52. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.5/1206147804896221174 +0 -0
  53. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.7/3657366982708166874 +0 -0
  54. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.6.9/285614542852677309 +0 -0
  55. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.7.1/1024065805990144819 +0 -0
  56. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.7.1/285614542852677309 +0 -0
  57. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.7.3/16061516852537040135 +0 -0
  58. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.8.4/16354268377385700367 +0 -0
  59. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
  60. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.9.10/923908772239632759 +0 -0
  61. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.9.3/13948373885254993391 +0 -0
  62. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.9.9/12813592349865671909 +0 -0
  63. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/0.9.9/8843823720003377982 +0 -0
  64. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
  65. {crackerjack-0.18.10 → crackerjack-0.18.11}/crackerjack/__init__.py +0 -0
  66. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/TESTING.md +0 -0
  67. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/__init__.py +0 -0
  68. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/conftest.py +0 -0
  69. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/data/comments_sample.txt +0 -0
  70. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/data/docstrings_sample.txt +0 -0
  71. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/data/expected_comments_sample.txt +0 -0
  72. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/data/init.py +0 -0
  73. {crackerjack-0.18.10 → crackerjack-0.18.11}/tests/test_main.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crackerjack
3
- Version: 0.18.10
3
+ Version: 0.18.11
4
4
  Summary: Default template for PDM package
5
5
  Keywords: black,ruff,mypy,creosote,refurb,pyright,bandit,pytest
6
6
  Author-Email: lesleslie <les@wedgwoodwebworks.com>
@@ -31,6 +31,7 @@ class Options(BaseModel):
31
31
  update_precommit: bool = False
32
32
  clean: bool = False
33
33
  test: bool = False
34
+ benchmark: bool = False
34
35
  all: BumpOption | None = None
35
36
  ai_agent: bool = False
36
37
  create_pr: bool = False
@@ -84,6 +85,11 @@ cli_options = {
84
85
  help="Remove docstrings, line comments, and unnecessary whitespace.",
85
86
  ),
86
87
  "test": typer.Option(False, "-t", "--test", help="Run tests."),
88
+ "benchmark": typer.Option(
89
+ False,
90
+ "--benchmark",
91
+ help="Run tests in benchmark mode (disables parallel execution).",
92
+ ),
87
93
  "skip_hooks": typer.Option(
88
94
  False,
89
95
  "-s",
@@ -125,6 +131,7 @@ def main(
125
131
  bump: BumpOption | None = cli_options["bump"],
126
132
  clean: bool = cli_options["clean"],
127
133
  test: bool = cli_options["test"],
134
+ benchmark: bool = cli_options["benchmark"],
128
135
  skip_hooks: bool = cli_options["skip_hooks"],
129
136
  create_pr: bool = cli_options["create_pr"],
130
137
  ai_agent: bool = cli_options["ai_agent"],
@@ -140,6 +147,7 @@ def main(
140
147
  bump=bump,
141
148
  clean=clean,
142
149
  test=test,
150
+ benchmark=benchmark,
143
151
  skip_hooks=skip_hooks,
144
152
  all=all,
145
153
  ai_agent=ai_agent,
@@ -39,6 +39,7 @@ class OptionsProtocol(t.Protocol):
39
39
  update_precommit: bool
40
40
  clean: bool
41
41
  test: bool
42
+ benchmark: bool = False
42
43
  publish: t.Any | None
43
44
  bump: t.Any | None
44
45
  all: t.Any | None
@@ -504,6 +505,9 @@ class Crackerjack:
504
505
  "--timeout=60", # 1-minute timeout for tests
505
506
  ]
506
507
  )
508
+ # Add benchmark flag if enabled (disables parallel execution)
509
+ if options.benchmark:
510
+ test.append("--benchmark")
507
511
  return test
508
512
 
509
513
  def _setup_test_environment(self) -> None:
@@ -158,7 +158,7 @@ pythonPlatform = "Darwin"
158
158
 
159
159
  [project]
160
160
  name = "crackerjack"
161
- version = "0.18.9"
161
+ version = "0.18.10"
162
162
  description = "Default template for PDM package"
163
163
  requires-python = ">=3.13"
164
164
  readme = "README.md"
@@ -179,7 +179,7 @@ pythonPlatform = "Darwin"
179
179
 
180
180
  [project]
181
181
  name = "crackerjack"
182
- version = "0.18.10"
182
+ version = "0.18.11"
183
183
  description = "Default template for PDM package"
184
184
  requires-python = ">=3.13"
185
185
  readme = "README.md"
@@ -37,6 +37,7 @@ class OptionsForTesting:
37
37
  update_precommit: bool = False
38
38
  clean: bool = False
39
39
  test: bool = False
40
+ benchmark: bool = False
40
41
  all: BumpOption | None = None
41
42
  ai_agent: bool = False
42
43
  create_pr: bool = False
@@ -1148,3 +1149,29 @@ class TestCrackerjackProcess:
1148
1149
  assert "crackerjack" not in (pkg_path / config).read_text()
1149
1150
  assert "test_package" in (pkg_path / config).read_text()
1150
1151
  mock_cm_execute.assert_any_call(["git", "add", config])
1152
+
1153
+ def test_prepare_pytest_command_with_benchmark(
1154
+ self,
1155
+ mock_execute: MagicMock,
1156
+ mock_console_print: MagicMock,
1157
+ tmp_path: Path,
1158
+ tmp_path_package: Path,
1159
+ create_package_dir: None,
1160
+ options_factory: t.Callable[..., OptionsForTesting],
1161
+ ) -> None:
1162
+ """Test that the benchmark option adds the --benchmark flag to pytest command."""
1163
+ # Create Crackerjack instance
1164
+ crackerjack = Crackerjack(
1165
+ pkg_path=tmp_path_package,
1166
+ console=Console(force_terminal=True),
1167
+ )
1168
+
1169
+ # Test with benchmark=False (default)
1170
+ options = options_factory(test=True, benchmark=False)
1171
+ test_command = crackerjack._prepare_pytest_command(options)
1172
+ assert "--benchmark" not in test_command
1173
+
1174
+ # Test with benchmark=True
1175
+ options = options_factory(test=True, benchmark=True)
1176
+ test_command = crackerjack._prepare_pytest_command(options)
1177
+ assert "--benchmark" in test_command
@@ -25,6 +25,7 @@ class MockOptions:
25
25
  self.ai_agent = kwargs.get("ai_agent", False)
26
26
  self.create_pr = kwargs.get("create_pr", False)
27
27
  self.skip_hooks = kwargs.get("skip_hooks", False)
28
+ self.benchmark = kwargs.get("benchmark", False)
28
29
 
29
30
 
30
31
  def test_create_crackerjack_runner() -> None:
@@ -0,0 +1,74 @@
1
+ """Tests for pytest timeout and parallel execution features."""
2
+
3
+ import time
4
+
5
+ import pytest
6
+
7
+
8
+ def test_normal_execution() -> None:
9
+ assert True
10
+
11
+
12
+ @pytest.mark.timeout(2)
13
+ def test_timeout_feature() -> None:
14
+ time.sleep(1)
15
+ assert True
16
+
17
+
18
+ @pytest.mark.xdist_group("group1")
19
+ def test_xdist_group1() -> None:
20
+ assert True
21
+
22
+
23
+ @pytest.mark.xdist_group("group1")
24
+ def test_xdist_group1_second() -> None:
25
+ assert True
26
+
27
+
28
+ @pytest.mark.xdist_group("group2")
29
+ def test_xdist_group2() -> None:
30
+ assert True
31
+
32
+
33
+ def test_slow_but_not_hanging() -> None:
34
+ time.sleep(12)
35
+ assert True
36
+
37
+
38
+ @pytest.mark.skip(reason="This test intentionally hangs to test timeout feature")
39
+ def test_hanging() -> None:
40
+ while True:
41
+ time.sleep(1)
42
+
43
+
44
+ @pytest.mark.benchmark
45
+ def test_benchmark_marker() -> None:
46
+ """Test that should run without xdist when marked with benchmark."""
47
+ # This test should run without parallelism when the benchmark option is used
48
+ start_time = time.time()
49
+ time.sleep(0.1) # Small sleep to simulate benchmark work
50
+ end_time = time.time()
51
+ duration = end_time - start_time
52
+ assert duration >= 0.1
53
+
54
+
55
+ @pytest.mark.benchmark
56
+ class TestBenchmarkClass:
57
+ """A class that contains benchmark tests."""
58
+
59
+ def test_benchmark_in_class(self) -> None:
60
+ """Test that benchmark marker works on classes too."""
61
+ assert True
62
+
63
+ def test_benchmark_with_timing(self) -> None:
64
+ """Test with precise timing measurement."""
65
+ results: list[float] = []
66
+ for _ in range(5):
67
+ start = time.time()
68
+ # Simple operation to benchmark
69
+ sum(range(10000))
70
+ end = time.time()
71
+ results.append(end - start)
72
+
73
+ # Check that we have consistent results (would fail under high contention)
74
+ assert max(results) - min(results) < 0.1
@@ -1,41 +0,0 @@
1
- """Tests for pytest timeout and parallel execution features."""
2
-
3
- import time
4
-
5
- import pytest
6
-
7
-
8
- def test_normal_execution() -> None:
9
- assert True
10
-
11
-
12
- @pytest.mark.timeout(2)
13
- def test_timeout_feature() -> None:
14
- time.sleep(1)
15
- assert True
16
-
17
-
18
- @pytest.mark.xdist_group("group1")
19
- def test_xdist_group1() -> None:
20
- assert True
21
-
22
-
23
- @pytest.mark.xdist_group("group1")
24
- def test_xdist_group1_second() -> None:
25
- assert True
26
-
27
-
28
- @pytest.mark.xdist_group("group2")
29
- def test_xdist_group2() -> None:
30
- assert True
31
-
32
-
33
- def test_slow_but_not_hanging() -> None:
34
- time.sleep(12)
35
- assert True
36
-
37
-
38
- @pytest.mark.skip(reason="This test intentionally hangs to test timeout feature")
39
- def test_hanging() -> None:
40
- while True:
41
- time.sleep(1)
File without changes
File without changes