crackerjack 0.20.1__py3-none-any.whl → 0.20.3__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/.ruff_cache/0.11.13/1867267426380906393 +0 -0
- crackerjack/crackerjack.py +26 -15
- crackerjack/pyproject.toml +1 -1
- {crackerjack-0.20.1.dist-info → crackerjack-0.20.3.dist-info}/METADATA +59 -3
- {crackerjack-0.20.1.dist-info → crackerjack-0.20.3.dist-info}/RECORD +8 -8
- {crackerjack-0.20.1.dist-info → crackerjack-0.20.3.dist-info}/WHEEL +0 -0
- {crackerjack-0.20.1.dist-info → crackerjack-0.20.3.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.20.1.dist-info → crackerjack-0.20.3.dist-info}/licenses/LICENSE +0 -0
Binary file
|
crackerjack/crackerjack.py
CHANGED
@@ -1022,23 +1022,34 @@ class Crackerjack:
|
|
1022
1022
|
|
1023
1023
|
if options.publish:
|
1024
1024
|
if platform.system() == "Darwin":
|
1025
|
-
|
1026
|
-
|
1025
|
+
# First check if keyring is already installed in PDM
|
1026
|
+
check_keyring = self.execute_command(
|
1027
|
+
["pdm", "self", "list"], capture_output=True, text=True
|
1027
1028
|
)
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
error=error,
|
1038
|
-
console=self.console,
|
1039
|
-
verbose=options.verbose,
|
1040
|
-
ai_agent=options.ai_agent,
|
1029
|
+
keyring_installed = "keyring" in check_keyring.stdout
|
1030
|
+
|
1031
|
+
if not keyring_installed:
|
1032
|
+
# Only attempt to install keyring if it's not already installed
|
1033
|
+
self.console.print("Installing keyring for PDM...")
|
1034
|
+
authorize = self.execute_command(
|
1035
|
+
["pdm", "self", "add", "keyring"],
|
1036
|
+
capture_output=True,
|
1037
|
+
text=True,
|
1041
1038
|
)
|
1039
|
+
if authorize.returncode > 0:
|
1040
|
+
error = PublishError(
|
1041
|
+
message="Authentication setup failed",
|
1042
|
+
error_code=ErrorCode.AUTHENTICATION_ERROR,
|
1043
|
+
details=f"Failed to add keyring support to PDM.\nCommand output:\n{authorize.stderr}",
|
1044
|
+
recovery="Please manually add your keyring credentials to PDM. Run `pdm self add keyring` and try again.",
|
1045
|
+
exit_code=1,
|
1046
|
+
)
|
1047
|
+
handle_error(
|
1048
|
+
error=error,
|
1049
|
+
console=self.console,
|
1050
|
+
verbose=options.verbose,
|
1051
|
+
ai_agent=options.ai_agent,
|
1052
|
+
)
|
1042
1053
|
|
1043
1054
|
build = self.execute_command(
|
1044
1055
|
["pdm", "build"], capture_output=True, text=True
|
crackerjack/pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: crackerjack
|
3
|
-
Version: 0.20.
|
3
|
+
Version: 0.20.3
|
4
4
|
Summary: Crackerjack: code quality toolkit
|
5
5
|
Keywords: bandit,black,creosote,mypy,pyright,pytest,refurb,ruff
|
6
6
|
Author-Email: lesleslie <les@wedgwoodwebworks.com>
|
@@ -192,9 +192,35 @@ Crackerjack provides advanced testing capabilities powered by pytest:
|
|
192
192
|
### Standard Testing
|
193
193
|
|
194
194
|
- **Parallel Test Execution:** Tests run in parallel by default using pytest-xdist for faster execution
|
195
|
-
- **
|
195
|
+
- **Smart Parallelization:** Automatically adjusts the number of worker processes based on project size
|
196
|
+
- **Timeout Protection:** Tests have dynamic timeouts based on project size to prevent hanging tests
|
196
197
|
- **Coverage Reports:** Automatically generates test coverage reports with configurable thresholds
|
197
198
|
|
199
|
+
### Advanced Test Configuration
|
200
|
+
|
201
|
+
Crackerjack offers fine-grained control over test execution:
|
202
|
+
|
203
|
+
- **Worker Control:** Set the number of parallel workers with `--test-workers` (0 = auto-detect, 1 = disable parallelization)
|
204
|
+
- **Timeout Control:** Customize test timeouts with `--test-timeout` (in seconds)
|
205
|
+
- **Project Size Detection:** Automatically detects project size and adjusts timeout and parallelization settings
|
206
|
+
- **Deadlock Prevention:** Uses advanced threading techniques to prevent deadlocks in test output processing
|
207
|
+
- **Progress Tracking:** Shows periodic heartbeat messages for long-running tests
|
208
|
+
|
209
|
+
Example test execution options:
|
210
|
+
```bash
|
211
|
+
# Run tests with a single worker (no parallelization)
|
212
|
+
python -m crackerjack -t --test-workers=1
|
213
|
+
|
214
|
+
# Run tests with a specific number of workers (e.g., 4)
|
215
|
+
python -m crackerjack -t --test-workers=4
|
216
|
+
|
217
|
+
# Run tests with a custom timeout (5 minutes per test)
|
218
|
+
python -m crackerjack -t --test-timeout=300
|
219
|
+
|
220
|
+
# Combine options for maximum control
|
221
|
+
python -m crackerjack -t --test-workers=2 --test-timeout=600
|
222
|
+
```
|
223
|
+
|
198
224
|
### Benchmark Testing
|
199
225
|
|
200
226
|
Crackerjack includes benchmark testing capabilities:
|
@@ -278,10 +304,16 @@ class MyOptions:
|
|
278
304
|
# Process options
|
279
305
|
self.clean = True # Clean code (remove docstrings, comments, etc.)
|
280
306
|
self.test = True # Run tests using pytest
|
307
|
+
self.skip_hooks = False # Skip running pre-commit hooks
|
308
|
+
|
309
|
+
# Test execution options
|
310
|
+
self.test_workers = 2 # Number of parallel workers (0 = auto-detect, 1 = disable parallelization)
|
311
|
+
self.test_timeout = 120 # Timeout in seconds for individual tests (0 = use default based on project size)
|
312
|
+
|
313
|
+
# Benchmark options
|
281
314
|
self.benchmark = False # Run tests in benchmark mode
|
282
315
|
self.benchmark_regression = False # Fail tests if benchmarks regress beyond threshold
|
283
316
|
self.benchmark_regression_threshold = 5.0 # Threshold percentage for benchmark regression
|
284
|
-
self.skip_hooks = False # Skip running pre-commit hooks
|
285
317
|
|
286
318
|
# Version and publishing options
|
287
319
|
self.publish = None # Publish to PyPI (micro, minor, major)
|
@@ -321,6 +353,8 @@ runner.process(MyOptions())
|
|
321
353
|
- `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`).
|
322
354
|
- `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
|
323
355
|
- `-t`, `--test`: Run tests using `pytest`.
|
356
|
+
- `--test-workers`: Set the number of parallel workers for testing (0 = auto-detect, 1 = disable parallelization).
|
357
|
+
- `--test-timeout`: Set the timeout in seconds for individual tests (0 = use default based on project size).
|
324
358
|
- `--benchmark`: Run tests in benchmark mode (disables parallel execution).
|
325
359
|
- `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold.
|
326
360
|
- `--benchmark-regression-threshold`: Set threshold percentage for benchmark regression (default 5.0%).
|
@@ -356,6 +390,28 @@ runner.process(MyOptions())
|
|
356
390
|
python -m crackerjack -t -s
|
357
391
|
```
|
358
392
|
|
393
|
+
#### Test Execution Options
|
394
|
+
|
395
|
+
- **Single-Process Testing** - Run tests sequentially (no parallelization):
|
396
|
+
```bash
|
397
|
+
python -m crackerjack -t --test-workers=1
|
398
|
+
```
|
399
|
+
|
400
|
+
- **Customized Parallel Testing** - Run tests with a specific number of workers:
|
401
|
+
```bash
|
402
|
+
python -m crackerjack -t --test-workers=4
|
403
|
+
```
|
404
|
+
|
405
|
+
- **Long-Running Tests** - Increase test timeout for complex tests:
|
406
|
+
```bash
|
407
|
+
python -m crackerjack -t --test-timeout=600
|
408
|
+
```
|
409
|
+
|
410
|
+
- **Optimized for Large Projects** - Reduce workers and increase timeout for large codebases:
|
411
|
+
```bash
|
412
|
+
python -m crackerjack -t --test-workers=2 --test-timeout=300
|
413
|
+
```
|
414
|
+
|
359
415
|
#### Version Management
|
360
416
|
|
361
417
|
- **Bump and Publish** - Bump version and publish to PyPI:
|
@@ -1,7 +1,7 @@
|
|
1
|
-
crackerjack-0.20.
|
2
|
-
crackerjack-0.20.
|
3
|
-
crackerjack-0.20.
|
4
|
-
crackerjack-0.20.
|
1
|
+
crackerjack-0.20.3.dist-info/METADATA,sha256=XNTChcz8YHD5P5n57GnqTS7wy7KymNgaqfm0wexV_D0,26354
|
2
|
+
crackerjack-0.20.3.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
crackerjack-0.20.3.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
|
+
crackerjack-0.20.3.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
5
5
|
crackerjack/.gitignore,sha256=4DYG7ZoVEHR5Tv1gQliRWmsNku5Fw2_k756cG_t12Cg,185
|
6
6
|
crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
|
7
7
|
crackerjack/.pdm.toml,sha256=dZe44HRcuxxCFESGG8SZIjmc-cGzSoyK3Hs6t4NYA8w,23
|
@@ -23,7 +23,7 @@ crackerjack/.ruff_cache/0.11.12/16869036553936192448,sha256=pYYUCDrYh7fPq8xkFLxv
|
|
23
23
|
crackerjack/.ruff_cache/0.11.12/1867267426380906393,sha256=2w4M0Lrjd9flwuq6uJxehTbm7FVUcK5sL2sz1gS2Yvo,256
|
24
24
|
crackerjack/.ruff_cache/0.11.12/4240757255861806333,sha256=uph5uIRG-XnF7ywAEcCxqqgIkWALPCvJFcwCgnNfTI4,77
|
25
25
|
crackerjack/.ruff_cache/0.11.12/4441409093023629623,sha256=eHrESew3XCFJ2WqmKvtGLO1r4mY5Q_mv7yGlDmM1sSc,153
|
26
|
-
crackerjack/.ruff_cache/0.11.13/1867267426380906393,sha256=
|
26
|
+
crackerjack/.ruff_cache/0.11.13/1867267426380906393,sha256=FQ8Z7PFzLBASpKw20TqKwD02FLSG_mj4C3cEt8nU2YY,256
|
27
27
|
crackerjack/.ruff_cache/0.11.2/4070660268492669020,sha256=FTRTUmvj6nZw_QQBp_WHI-h3_iqRejzL39api-9wTvs,224
|
28
28
|
crackerjack/.ruff_cache/0.11.3/9818742842212983150,sha256=U-4mT__a-OljovvAJvv5M6X7TCMa3dReLXx3kTNGgwU,224
|
29
29
|
crackerjack/.ruff_cache/0.11.4/9818742842212983150,sha256=QF9j6-3MH_d0pDNotdbF2hlqCL66SxN8OLVKR3PZyZU,224
|
@@ -60,9 +60,9 @@ crackerjack/.ruff_cache/0.9.9/8843823720003377982,sha256=e4ymkXfQsUg5e_mtO34xTsa
|
|
60
60
|
crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
|
61
61
|
crackerjack/__init__.py,sha256=w5jukdION0D0fyeKYl-7hfCPzI0isXbEjzdjw8RecKA,840
|
62
62
|
crackerjack/__main__.py,sha256=jg-eO0Z1VZkx5F-97dsd1rxOQ0uwHWabuKma8thUJVw,6779
|
63
|
-
crackerjack/crackerjack.py,sha256=
|
63
|
+
crackerjack/crackerjack.py,sha256=DpbodHdqeoyA0_QC6ADGtNX0A3zMIPpnWqk2UsIdyQw,53203
|
64
64
|
crackerjack/errors.py,sha256=OtbmtA912kzDOWVo6JASuFbaMU-VhmQD_fUNsvnWCZc,4311
|
65
65
|
crackerjack/interactive.py,sha256=Ay7_s3pc4ntc_3F_bRKBsWxmjor6nkN9v6tqqJe1iRw,15904
|
66
66
|
crackerjack/py313.py,sha256=VgthlcpLL6nNDcg3evvEmGNYWCdMuojnMhow58ISEdY,6184
|
67
|
-
crackerjack/pyproject.toml,sha256=
|
68
|
-
crackerjack-0.20.
|
67
|
+
crackerjack/pyproject.toml,sha256=HLvG6faHtQDxAtTYK7ujGjPX93n_OLCIgdOaPYtTago,4843
|
68
|
+
crackerjack-0.20.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|