crackerjack 0.25.0__py3-none-any.whl → 0.27.0__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.
Potentially problematic release.
This version of crackerjack might be problematic. Click here for more details.
- crackerjack/.gitignore +11 -0
- crackerjack/.pre-commit-config-ai.yaml +60 -33
- crackerjack/.pre-commit-config.yaml +31 -5
- crackerjack/__main__.py +22 -1
- crackerjack/crackerjack.py +1360 -39
- crackerjack/pyproject.toml +71 -30
- {crackerjack-0.25.0.dist-info → crackerjack-0.27.0.dist-info}/METADATA +188 -128
- crackerjack-0.27.0.dist-info/RECORD +16 -0
- crackerjack-0.25.0.dist-info/RECORD +0 -16
- {crackerjack-0.25.0.dist-info → crackerjack-0.27.0.dist-info}/WHEEL +0 -0
- {crackerjack-0.25.0.dist-info → crackerjack-0.27.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crackerjack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.27.0
|
|
4
4
|
Summary: Crackerjack: code quality toolkit
|
|
5
5
|
Project-URL: documentation, https://github.com/lesleslie/crackerjack
|
|
6
6
|
Project-URL: homepage, https://github.com/lesleslie/crackerjack
|
|
@@ -23,11 +23,13 @@ Classifier: Topic :: Software Development :: Testing
|
|
|
23
23
|
Classifier: Topic :: Utilities
|
|
24
24
|
Classifier: Typing :: Typed
|
|
25
25
|
Requires-Python: >=3.13
|
|
26
|
+
Requires-Dist: aiofiles>=24.1
|
|
26
27
|
Requires-Dist: autotyping>=24.9
|
|
27
28
|
Requires-Dist: hatchling>=1.25
|
|
28
29
|
Requires-Dist: keyring>=25.6
|
|
29
30
|
Requires-Dist: pre-commit>=4.2
|
|
30
31
|
Requires-Dist: pydantic>=2.11.7
|
|
32
|
+
Requires-Dist: pyleak>=0.1.14
|
|
31
33
|
Requires-Dist: pytest-asyncio>=1
|
|
32
34
|
Requires-Dist: pytest-benchmark>=5.1
|
|
33
35
|
Requires-Dist: pytest-cov>=6.2.1
|
|
@@ -63,68 +65,80 @@ Crackerjack is an opinionated Python project management tool that streamlines th
|
|
|
63
65
|
Crackerjack solves three critical challenges in Python development:
|
|
64
66
|
|
|
65
67
|
1. **Project Setup & Configuration**
|
|
68
|
+
|
|
66
69
|
- **Challenge**: Setting up Python projects with best practices requires knowledge of numerous tools and configurations
|
|
67
70
|
- **Solution**: Crackerjack automates project initialization with pre-configured templates and industry best practices
|
|
68
71
|
|
|
69
|
-
|
|
72
|
+
1. **Code Quality & Consistency**
|
|
73
|
+
|
|
70
74
|
- **Challenge**: Maintaining consistent code quality across a project and team requires constant vigilance
|
|
71
75
|
- **Solution**: Crackerjack enforces a unified style through integrated linting, formatting, and pre-commit hooks
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
1. **Streamlined Publishing**
|
|
78
|
+
|
|
74
79
|
- **Challenge**: Publishing Python packages involves many manual, error-prone steps
|
|
75
80
|
- **Solution**: Crackerjack automates the entire release process from testing to version bumping to publishing
|
|
76
81
|
|
|
77
82
|
Crackerjack integrates powerful tools like Ruff, UV, pre-commit, pytest, and more into a cohesive system that ensures code quality, consistency, and reliability. It's designed for developers who value both productivity and excellence.
|
|
78
83
|
|
|
79
|
-
|
|
84
|
+
______________________________________________________________________
|
|
80
85
|
|
|
81
86
|
## Getting Started
|
|
82
87
|
|
|
83
88
|
### Quick Start
|
|
84
89
|
|
|
85
90
|
If you're new to Crackerjack, follow these steps:
|
|
91
|
+
|
|
86
92
|
1. **Install Python 3.13:** Ensure you have Python 3.13 or higher installed.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
|
|
94
|
+
1. **Install UV:**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
pipx install uv
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
1. **Install Crackerjack:**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
pip install crackerjack
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
1. **Initialize a New Project:**
|
|
107
|
+
Navigate to your project's root directory and run:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
python -m crackerjack
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Or use the interactive Rich UI:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
python -m crackerjack -i
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
______________________________________________________________________
|
|
108
120
|
|
|
109
121
|
## The Crackerjack Philosophy
|
|
110
122
|
|
|
111
123
|
Crackerjack is built on the following core principles:
|
|
112
124
|
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
125
|
+
- **Code Clarity:** Code should be easy to read, understand, and maintain.
|
|
126
|
+
- **Automation:** Tedious tasks should be automated, allowing developers to focus on solving problems.
|
|
127
|
+
- **Consistency:** Code style, formatting, and project structure should be consistent across projects.
|
|
128
|
+
- **Reliability:** Tests are essential, and code should be checked rigorously.
|
|
129
|
+
- **Tool Integration:** Leverage powerful existing tools instead of reinventing the wheel.
|
|
130
|
+
- **Static Typing:** Static typing is essential for all development.
|
|
119
131
|
|
|
120
132
|
## Key Features
|
|
121
133
|
|
|
122
134
|
### Project Management
|
|
135
|
+
|
|
123
136
|
- **Effortless Project Setup:** Initializes new Python projects with a standard directory structure, `pyproject.toml`, and essential configuration files
|
|
124
137
|
- **UV Integration:** Manages dependencies and virtual environments using [UV](https://github.com/astral-sh/uv) for lightning-fast package operations
|
|
125
138
|
- **Dependency Management:** Automatically detects and manages project dependencies
|
|
126
139
|
|
|
127
140
|
### Code Quality
|
|
141
|
+
|
|
128
142
|
- **Automated Code Cleaning:** Removes unnecessary docstrings, line comments, and trailing whitespace
|
|
129
143
|
- **Consistent Code Formatting:** Enforces a unified style using [Ruff](https://github.com/astral-sh/ruff), the lightning-fast Python linter and formatter
|
|
130
144
|
- **Comprehensive Pre-commit Hooks:** Installs and manages a robust suite of pre-commit hooks (see the "Pre-commit Hooks" section below)
|
|
@@ -132,16 +146,19 @@ Crackerjack is built on the following core principles:
|
|
|
132
146
|
- **Static Type Checking:** Enforces type safety with Pyright integration
|
|
133
147
|
|
|
134
148
|
### Testing & Deployment
|
|
149
|
+
|
|
135
150
|
- **Built-in Testing:** Automatically runs tests using `pytest`
|
|
136
151
|
- **Easy Version Bumping:** Provides commands to bump the project version (patch, minor, or major)
|
|
137
152
|
- **Simplified Publishing:** Automates publishing to PyPI via UV
|
|
138
153
|
|
|
139
154
|
### Git Integration
|
|
155
|
+
|
|
140
156
|
- **Commit and Push:** Commits and pushes your changes with standardized commit messages
|
|
141
157
|
- **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab
|
|
142
158
|
- **Pre-commit Integration:** Ensures code quality before commits
|
|
143
159
|
|
|
144
160
|
### Developer Experience
|
|
161
|
+
|
|
145
162
|
- **Command-Line Interface:** Simple, intuitive CLI with comprehensive options
|
|
146
163
|
- **Interactive Rich UI:** Visual workflow with real-time task tracking, progress visualization, and interactive prompts
|
|
147
164
|
- **Structured Error Handling:** Clear error messages with error codes, detailed explanations, and recovery suggestions
|
|
@@ -154,37 +171,37 @@ Crackerjack is built on the following core principles:
|
|
|
154
171
|
|
|
155
172
|
Crackerjack automatically installs and manages these pre-commit hooks:
|
|
156
173
|
|
|
157
|
-
1.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
1. **uv-lock:** Ensures the `uv.lock` file is up to date.
|
|
175
|
+
1. **Core pre-commit-hooks:** Essential hooks from [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) (e.g., `trailing-whitespace`, `end-of-file-fixer`).
|
|
176
|
+
1. **Ruff:** [Ruff](https://github.com/astral-sh/ruff) for linting, code formatting, and general code style enforcement.
|
|
177
|
+
1. **Vulture:** [Vulture](https://github.com/jendrikseipp/vulture) to identify dead code.
|
|
178
|
+
1. **Creosote:** [Creosote](https://github.com/fredrikaverpil/creosote) to detect unused dependencies.
|
|
179
|
+
1. **Complexipy:** [Complexipy](https://github.com/rohaquinlop/complexipy-pre-commit) for analyzing code complexity.
|
|
180
|
+
1. **Codespell:** [Codespell](https://github.com/codespell-project/codespell) for correcting typos in the code.
|
|
181
|
+
1. **Autotyping:** [Autotyping](https://github.com/JelleZijlstra/autotyping) for adding type hints.
|
|
182
|
+
1. **Refurb:** [Refurb](https://github.com/dosisod/refurb) to suggest code improvements.
|
|
183
|
+
1. **Bandit:** [Bandit](https://github.com/PyCQA/bandit) to identify potential security vulnerabilities.
|
|
184
|
+
1. **Pyright:** [Pyright](https://github.com/RobertCraigie/pyright-python) for static type checking.
|
|
185
|
+
1. **Ruff (again):** A final Ruff pass to ensure all changes comply with the enforced style.
|
|
169
186
|
|
|
170
187
|
## The Crackerjack Style Guide
|
|
171
188
|
|
|
172
189
|
Crackerjack projects adhere to these guidelines:
|
|
173
190
|
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
191
|
+
- **Static Typing:** Use type hints consistently throughout your code.
|
|
192
|
+
- **Modern Type Hints:** Use the pipe operator (`|`) for union types (e.g., `Path | None` instead of `Optional[Path]`).
|
|
193
|
+
- **Explicit Naming:** Choose clear, descriptive names for classes, functions, variables, and other identifiers.
|
|
194
|
+
- **Markdown for Documentation:** Use Markdown (`.md`) for all documentation, READMEs, etc.
|
|
195
|
+
- **Pathlib:** Use `pathlib.Path` for handling file and directory paths instead of `os.path`.
|
|
196
|
+
- **Consistent Imports:** Use `import typing as t` for type hinting and prefix all typing references with `t.`.
|
|
197
|
+
- **Protocol-Based Design:** Use `t.Protocol` for interface definitions instead of abstract base classes.
|
|
198
|
+
- **Constants and Config:** Do not use all-caps for constants or configuration settings.
|
|
199
|
+
- **Path Parameters:** Functions that handle file operations should accept `pathlib.Path` objects as parameters.
|
|
200
|
+
- **Dependency Management:** Use UV for dependency management, package building, and publishing.
|
|
201
|
+
- **Testing:** Use pytest as your testing framework.
|
|
202
|
+
- **Python Version:** Crackerjack projects target Python 3.13+ and use the latest language features.
|
|
203
|
+
- **Clear Code:** Avoid overly complex code.
|
|
204
|
+
- **Modular:** Functions should do one thing well.
|
|
188
205
|
|
|
189
206
|
## Testing Features
|
|
190
207
|
|
|
@@ -208,6 +225,7 @@ Crackerjack offers fine-grained control over test execution:
|
|
|
208
225
|
- **Progress Tracking:** Shows periodic heartbeat messages for long-running tests
|
|
209
226
|
|
|
210
227
|
Example test execution options:
|
|
228
|
+
|
|
211
229
|
```bash
|
|
212
230
|
# Run tests with a single worker (no parallelization)
|
|
213
231
|
python -m crackerjack -t --test-workers=1
|
|
@@ -233,12 +251,14 @@ Crackerjack includes benchmark testing capabilities:
|
|
|
233
251
|
- **CI Integration:** Track performance across commits with benchmark history
|
|
234
252
|
|
|
235
253
|
When benchmarks are run, Crackerjack:
|
|
254
|
+
|
|
236
255
|
1. Disables parallel test execution (as pytest-benchmark is incompatible with pytest-xdist)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
256
|
+
1. Configures the pytest-benchmark plugin with optimized settings
|
|
257
|
+
1. Compares benchmark results against previous runs when regression testing is enabled
|
|
258
|
+
1. Fails tests if performance decreases beyond the specified threshold
|
|
240
259
|
|
|
241
260
|
Example benchmark usage:
|
|
261
|
+
|
|
242
262
|
```bash
|
|
243
263
|
# Run benchmarks
|
|
244
264
|
python -m crackerjack -t --benchmark
|
|
@@ -252,24 +272,27 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
|
|
|
252
272
|
|
|
253
273
|
## Installation
|
|
254
274
|
|
|
255
|
-
1.
|
|
256
|
-
|
|
275
|
+
1. **Python:** Ensure you have Python 3.13 or higher installed.
|
|
276
|
+
|
|
277
|
+
1. **UV:** Install [UV](https://github.com/astral-sh/uv) using `pipx`:
|
|
257
278
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
279
|
+
```
|
|
280
|
+
pipx install uv
|
|
281
|
+
```
|
|
261
282
|
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
pip install crackerjack
|
|
265
|
-
cd your_project_root
|
|
266
|
-
python -m crackerjack
|
|
267
|
-
```
|
|
283
|
+
1. **Crackerjack:** Install Crackerjack and initialize in your project root using:
|
|
268
284
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
285
|
+
```
|
|
286
|
+
pip install crackerjack
|
|
287
|
+
cd your_project_root
|
|
288
|
+
python -m crackerjack
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Or with the interactive Rich UI:
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
python -m crackerjack -i
|
|
295
|
+
```
|
|
273
296
|
|
|
274
297
|
## Usage
|
|
275
298
|
|
|
@@ -277,7 +300,9 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
|
|
|
277
300
|
|
|
278
301
|
Run Crackerjack from the root of your Python project using:
|
|
279
302
|
|
|
280
|
-
|
|
303
|
+
```
|
|
304
|
+
python -m crackerjack
|
|
305
|
+
```
|
|
281
306
|
|
|
282
307
|
### Programmatic API
|
|
283
308
|
|
|
@@ -289,89 +314,96 @@ from pathlib import Path
|
|
|
289
314
|
from rich.console import Console
|
|
290
315
|
from crackerjack import create_crackerjack_runner
|
|
291
316
|
|
|
317
|
+
|
|
292
318
|
# Create a custom options object
|
|
293
319
|
class MyOptions:
|
|
294
320
|
def __init__(self):
|
|
295
321
|
# Core options
|
|
296
|
-
self.commit = False
|
|
297
|
-
self.interactive = True
|
|
298
|
-
self.verbose = True
|
|
322
|
+
self.commit = False # Commit changes to Git
|
|
323
|
+
self.interactive = True # Run pre-commit hooks interactively
|
|
324
|
+
self.verbose = True # Enable verbose output
|
|
299
325
|
|
|
300
326
|
# Configuration options
|
|
301
327
|
self.no_config_updates = False # Skip updating config files
|
|
302
|
-
self.update_precommit = False
|
|
328
|
+
self.update_precommit = False # Update pre-commit hooks
|
|
303
329
|
|
|
304
330
|
# Process options
|
|
305
|
-
self.clean = True
|
|
306
|
-
self.test = True
|
|
307
|
-
self.skip_hooks = False
|
|
331
|
+
self.clean = True # Clean code (remove docstrings, comments, etc.)
|
|
332
|
+
self.test = True # Run tests using pytest
|
|
333
|
+
self.skip_hooks = False # Skip running pre-commit hooks
|
|
308
334
|
|
|
309
335
|
# Test execution options
|
|
310
|
-
self.test_workers = 2
|
|
311
|
-
self.test_timeout = 120
|
|
336
|
+
self.test_workers = 2 # Number of parallel workers (0 = auto-detect, 1 = disable parallelization)
|
|
337
|
+
self.test_timeout = 120 # Timeout in seconds for individual tests (0 = use default based on project size)
|
|
312
338
|
|
|
313
339
|
# Benchmark options
|
|
314
|
-
self.benchmark = False
|
|
315
|
-
self.benchmark_regression =
|
|
316
|
-
|
|
340
|
+
self.benchmark = False # Run tests in benchmark mode
|
|
341
|
+
self.benchmark_regression = (
|
|
342
|
+
False # Fail tests if benchmarks regress beyond threshold
|
|
343
|
+
)
|
|
344
|
+
self.benchmark_regression_threshold = (
|
|
345
|
+
5.0 # Threshold percentage for benchmark regression
|
|
346
|
+
)
|
|
317
347
|
|
|
318
348
|
# Version and publishing options
|
|
319
|
-
self.publish = None
|
|
320
|
-
self.bump = "patch"
|
|
321
|
-
self.all = None
|
|
349
|
+
self.publish = None # Publish to PyPI (patch, minor, major)
|
|
350
|
+
self.bump = "patch" # Bump version (patch, minor, major)
|
|
351
|
+
self.all = None # Run with -x -t -p <version> -c
|
|
322
352
|
|
|
323
353
|
# Git options
|
|
324
|
-
self.create_pr = False
|
|
354
|
+
self.create_pr = False # Create a pull request
|
|
325
355
|
|
|
326
356
|
# Integration options
|
|
327
|
-
self.ai_agent = False
|
|
357
|
+
self.ai_agent = False # Enable AI agent structured output
|
|
358
|
+
|
|
328
359
|
|
|
329
360
|
# Create a Crackerjack runner with custom settings
|
|
330
361
|
runner = create_crackerjack_runner(
|
|
331
362
|
console=Console(force_terminal=True), # Rich console for pretty output
|
|
332
|
-
pkg_path=Path.cwd(),
|
|
333
|
-
python_version="3.13",
|
|
334
|
-
dry_run=False
|
|
363
|
+
pkg_path=Path.cwd(), # Path to your project
|
|
364
|
+
python_version="3.13", # Target Python version
|
|
365
|
+
dry_run=False, # Set to True to simulate without changes
|
|
335
366
|
)
|
|
336
367
|
|
|
337
368
|
# Run Crackerjack with your options
|
|
338
369
|
runner.process(MyOptions())
|
|
339
370
|
```
|
|
340
371
|
|
|
341
|
-
|
|
342
372
|
### Command-Line Options
|
|
343
373
|
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
-
|
|
362
|
-
-
|
|
363
|
-
-
|
|
374
|
+
- `-c`, `--commit`: Commit changes to Git.
|
|
375
|
+
- `-i`, `--interactive`: Run pre-commit hooks interactively when possible.
|
|
376
|
+
- `-n`, `--no-config-updates`: Skip updating configuration files (e.g., `pyproject.toml`).
|
|
377
|
+
- `-u`, `--update-precommit`: Update pre-commit hooks to the latest versions.
|
|
378
|
+
- `-v`, `--verbose`: Enable verbose output.
|
|
379
|
+
- `-p`, `--publish <patch|minor|major>`: Bump the project version and publish to PyPI using UV.
|
|
380
|
+
- `-b`, `--bump <patch|minor|major>`: Bump the project version without publishing.
|
|
381
|
+
- `-r`, `--pr`: Create a pull request to the upstream repository.
|
|
382
|
+
- `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`).
|
|
383
|
+
- `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
|
|
384
|
+
- `-t`, `--test`: Run tests using `pytest`.
|
|
385
|
+
- `--test-workers`: Set the number of parallel workers for testing (0 = auto-detect, 1 = disable parallelization).
|
|
386
|
+
- `--test-timeout`: Set the timeout in seconds for individual tests (0 = use default based on project size).
|
|
387
|
+
- `--benchmark`: Run tests in benchmark mode (disables parallel execution).
|
|
388
|
+
- `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold.
|
|
389
|
+
- `--benchmark-regression-threshold`: Set threshold percentage for benchmark regression (default 5.0%).
|
|
390
|
+
- `-a`, `--all`: Run with `-x -t -p <patch|minor|major> -c` development options.
|
|
391
|
+
- `-i`, `--interactive`: Enable the interactive Rich UI for a more user-friendly experience with visual progress tracking and interactive prompts.
|
|
392
|
+
- `--ai-agent`: Enable AI agent mode with structured output (see [AI Agent Integration](#ai-agent-integration)).
|
|
393
|
+
- `--help`: Display help.
|
|
364
394
|
|
|
365
395
|
### Example Workflows
|
|
366
396
|
|
|
367
397
|
#### Development Workflows
|
|
368
398
|
|
|
369
399
|
- **Quick Check** - Run basic checks on your code:
|
|
400
|
+
|
|
370
401
|
```bash
|
|
371
402
|
python -m crackerjack
|
|
372
403
|
```
|
|
373
404
|
|
|
374
405
|
- **Full Development Cycle** - Clean, test, bump version, publish, and commit:
|
|
406
|
+
|
|
375
407
|
```bash
|
|
376
408
|
python -m crackerjack -a minor # All-in-one command
|
|
377
409
|
|
|
@@ -380,11 +412,13 @@ runner.process(MyOptions())
|
|
|
380
412
|
```
|
|
381
413
|
|
|
382
414
|
- **Development with Tests** - Clean code, run checks, run tests, then commit:
|
|
415
|
+
|
|
383
416
|
```bash
|
|
384
417
|
python -m crackerjack -c -x -t
|
|
385
418
|
```
|
|
386
419
|
|
|
387
420
|
- **Fast Testing** - Run tests without running pre-commit hooks:
|
|
421
|
+
|
|
388
422
|
```bash
|
|
389
423
|
python -m crackerjack -t -s
|
|
390
424
|
```
|
|
@@ -392,21 +426,25 @@ runner.process(MyOptions())
|
|
|
392
426
|
#### Test Execution Options
|
|
393
427
|
|
|
394
428
|
- **Single-Process Testing** - Run tests sequentially (no parallelization):
|
|
429
|
+
|
|
395
430
|
```bash
|
|
396
431
|
python -m crackerjack -t --test-workers=1
|
|
397
432
|
```
|
|
398
433
|
|
|
399
434
|
- **Customized Parallel Testing** - Run tests with a specific number of workers:
|
|
435
|
+
|
|
400
436
|
```bash
|
|
401
437
|
python -m crackerjack -t --test-workers=4
|
|
402
438
|
```
|
|
403
439
|
|
|
404
440
|
- **Long-Running Tests** - Increase test timeout for complex tests:
|
|
441
|
+
|
|
405
442
|
```bash
|
|
406
443
|
python -m crackerjack -t --test-timeout=600
|
|
407
444
|
```
|
|
408
445
|
|
|
409
446
|
- **Optimized for Large Projects** - Reduce workers and increase timeout for large codebases:
|
|
447
|
+
|
|
410
448
|
```bash
|
|
411
449
|
python -m crackerjack -t --test-workers=2 --test-timeout=300
|
|
412
450
|
```
|
|
@@ -414,6 +452,7 @@ runner.process(MyOptions())
|
|
|
414
452
|
#### Version Management
|
|
415
453
|
|
|
416
454
|
- **Bump and Publish** - Bump version and publish to PyPI:
|
|
455
|
+
|
|
417
456
|
```bash
|
|
418
457
|
python -m crackerjack -p patch # For patch version
|
|
419
458
|
python -m crackerjack -p minor # For minor version
|
|
@@ -421,6 +460,7 @@ runner.process(MyOptions())
|
|
|
421
460
|
```
|
|
422
461
|
|
|
423
462
|
- **Version Bump Only** - Bump version without publishing:
|
|
463
|
+
|
|
424
464
|
```bash
|
|
425
465
|
python -m crackerjack -b major
|
|
426
466
|
```
|
|
@@ -428,11 +468,13 @@ runner.process(MyOptions())
|
|
|
428
468
|
#### Configuration Management
|
|
429
469
|
|
|
430
470
|
- **Skip Config Updates** - Run checks without updating configuration files:
|
|
471
|
+
|
|
431
472
|
```bash
|
|
432
473
|
python -m crackerjack -n
|
|
433
474
|
```
|
|
434
475
|
|
|
435
476
|
- **Update Hooks** - Update pre-commit hooks to latest versions:
|
|
477
|
+
|
|
436
478
|
```bash
|
|
437
479
|
python -m crackerjack -u
|
|
438
480
|
```
|
|
@@ -440,11 +482,13 @@ runner.process(MyOptions())
|
|
|
440
482
|
#### Git Operations
|
|
441
483
|
|
|
442
484
|
- **Commit Changes** - Run checks and commit changes:
|
|
485
|
+
|
|
443
486
|
```bash
|
|
444
487
|
python -m crackerjack -c
|
|
445
488
|
```
|
|
446
489
|
|
|
447
490
|
- **Create PR** - Create a pull request to the upstream repository:
|
|
491
|
+
|
|
448
492
|
```bash
|
|
449
493
|
python -m crackerjack -r
|
|
450
494
|
```
|
|
@@ -452,21 +496,25 @@ runner.process(MyOptions())
|
|
|
452
496
|
#### Other Operations
|
|
453
497
|
|
|
454
498
|
- **Interactive Mode** - Run pre-commit hooks interactively:
|
|
499
|
+
|
|
455
500
|
```bash
|
|
456
501
|
python -m crackerjack -i
|
|
457
502
|
```
|
|
458
503
|
|
|
459
504
|
- **Rich Interactive Mode** - Run with the interactive Rich UI:
|
|
505
|
+
|
|
460
506
|
```bash
|
|
461
507
|
python -m crackerjack -i
|
|
462
508
|
```
|
|
463
509
|
|
|
464
510
|
- **AI Integration** - Run with structured output for AI tools:
|
|
511
|
+
|
|
465
512
|
```bash
|
|
466
513
|
python -m crackerjack --ai-agent --test
|
|
467
514
|
```
|
|
468
515
|
|
|
469
516
|
- **Help** - Display command help:
|
|
517
|
+
|
|
470
518
|
```bash
|
|
471
519
|
python -m crackerjack --help
|
|
472
520
|
```
|
|
@@ -504,11 +552,12 @@ python -m crackerjack -i
|
|
|
504
552
|
```
|
|
505
553
|
|
|
506
554
|
This launches an interactive terminal interface where you can:
|
|
555
|
+
|
|
507
556
|
1. View all available tasks and their dependencies
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
557
|
+
1. Confirm each task before execution
|
|
558
|
+
1. Get detailed status information for running tasks
|
|
559
|
+
1. See a summary of completed, failed, and skipped tasks
|
|
560
|
+
1. Visualize error details with recovery suggestions
|
|
512
561
|
|
|
513
562
|
## Structured Error Handling
|
|
514
563
|
|
|
@@ -521,6 +570,7 @@ Crackerjack implements a comprehensive error handling system that provides:
|
|
|
521
570
|
- **Rich Formatting:** Errors are presented with clear visual formatting (when using Rich UI or verbose mode)
|
|
522
571
|
|
|
523
572
|
Error types include:
|
|
573
|
+
|
|
524
574
|
- Configuration errors (1000-1999)
|
|
525
575
|
- Execution errors (2000-2999)
|
|
526
576
|
- Test errors (3000-3999)
|
|
@@ -553,6 +603,7 @@ Crackerjack is designed to leverage the latest Python 3.13+ language features:
|
|
|
553
603
|
- **Modern Dictionary Patterns:** Leverages structural pattern matching with dictionaries for cleaner data handling
|
|
554
604
|
|
|
555
605
|
These modern Python features contribute to:
|
|
606
|
+
|
|
556
607
|
- More readable and maintainable code
|
|
557
608
|
- Better static type checking with tools like pyright
|
|
558
609
|
- Cleaner, more concise implementations
|
|
@@ -567,14 +618,16 @@ Crackerjack is an evolving project. Contributions are welcome! Please open a pul
|
|
|
567
618
|
To contribute:
|
|
568
619
|
|
|
569
620
|
1. Add Crackerjack as a development dependency to your project:
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
621
|
+
|
|
622
|
+
```
|
|
623
|
+
uv add --dev crackerjack
|
|
624
|
+
```
|
|
573
625
|
|
|
574
626
|
2. Run checks and tests before submitting:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
627
|
+
|
|
628
|
+
```
|
|
629
|
+
python -m crackerjack -x -t
|
|
630
|
+
```
|
|
578
631
|
|
|
579
632
|
This ensures your code meets all quality standards before submission.
|
|
580
633
|
|
|
@@ -598,12 +651,14 @@ Crackerjack is designed with modern Python principles in mind:
|
|
|
598
651
|
Crackerjack stands on the shoulders of giants. We're grateful to the maintainers and contributors of these outstanding tools that make modern Python development possible:
|
|
599
652
|
|
|
600
653
|
### Core Development Tools
|
|
654
|
+
|
|
601
655
|
- **[UV](https://docs.astral.sh/uv/)** - Next-generation Python package and project management
|
|
602
656
|
- **[Ruff](https://docs.astral.sh/ruff/)** - Lightning-fast Python linter and formatter written in Rust
|
|
603
657
|
- **[pyright](https://microsoft.github.io/pyright/)** - Fast, feature-rich static type checker for Python
|
|
604
658
|
- **[pytest](https://pytest.org/)** - Flexible and powerful testing framework
|
|
605
659
|
|
|
606
660
|
### Code Quality & Security
|
|
661
|
+
|
|
607
662
|
- **[pre-commit](https://pre-commit.com/)** - Multi-language pre-commit hooks framework
|
|
608
663
|
- **[bandit](https://bandit.readthedocs.io/)** - Security vulnerability scanner for Python
|
|
609
664
|
- **[vulture](https://github.com/jendrikseipp/vulture)** - Dead code detection tool
|
|
@@ -612,26 +667,31 @@ Crackerjack stands on the shoulders of giants. We're grateful to the maintainers
|
|
|
612
667
|
- **[detect-secrets](https://github.com/Yelp/detect-secrets)** - Prevention of secrets in repositories
|
|
613
668
|
|
|
614
669
|
### Dependencies & Project Management
|
|
670
|
+
|
|
615
671
|
- **[creosote](https://github.com/fredrikaverpil/creosote)** - Unused dependency detection
|
|
616
672
|
- **[autotyping](https://github.com/JelleZijlstra/autotyping)** - Automatic type hint generation
|
|
617
673
|
- **[complexipy](https://github.com/rohaquinlop/complexipy)** - Code complexity analysis
|
|
618
674
|
|
|
619
675
|
### CLI & User Interface
|
|
676
|
+
|
|
620
677
|
- **[Typer](https://typer.tiangolo.com/)** - Modern CLI framework for building command-line interfaces
|
|
621
678
|
- **[Rich](https://rich.readthedocs.io/)** - Rich text and beautiful formatting in the terminal
|
|
622
679
|
- **[click](https://click.palletsprojects.com/)** - Python package for creating command line interfaces
|
|
623
680
|
|
|
624
681
|
### Performance & Development Tools
|
|
682
|
+
|
|
625
683
|
- **[icecream](https://github.com/gruns/icecream)** - Sweet and creamy print debugging
|
|
626
684
|
- **[bevy](https://github.com/ZeroIntensity/bevy)** - Lightweight dependency injection framework
|
|
627
685
|
- **[msgspec](https://github.com/jcrist/msgspec)** - High-performance message serialization
|
|
628
686
|
- **[attrs](https://github.com/python-attrs/attrs)** - Classes without boilerplate
|
|
629
687
|
|
|
630
688
|
### Development Environment
|
|
689
|
+
|
|
631
690
|
- **[PyCharm](https://www.jetbrains.com/pycharm/)** - The premier Python IDE that powered the development of Crackerjack
|
|
632
691
|
- **[Claude Code](https://claude.ai/code)** - AI-powered development assistant that accelerated development and ensured code quality
|
|
633
692
|
|
|
634
693
|
### Legacy Inspiration
|
|
694
|
+
|
|
635
695
|
- **[PDM](https://pdm.fming.dev/)** - Original inspiration for modern Python dependency management patterns
|
|
636
696
|
|
|
637
697
|
### Special Recognition
|
|
@@ -642,4 +702,4 @@ The integration of these tools into Crackerjack's unified workflow demonstrates
|
|
|
642
702
|
|
|
643
703
|
We're honored to build upon this foundation and contribute to the Python community's continued evolution toward better development practices and tools.
|
|
644
704
|
|
|
645
|
-
|
|
705
|
+
______________________________________________________________________
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
crackerjack/.gitignore,sha256=_d0WeGfNZQeCgzJXmjL9LKf-6jjytBulH-ZfWiIOZWI,453
|
|
2
|
+
crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
|
|
3
|
+
crackerjack/.pdm.toml,sha256=dZe44HRcuxxCFESGG8SZIjmc-cGzSoyK3Hs6t4NYA8w,23
|
|
4
|
+
crackerjack/.pre-commit-config-ai.yaml,sha256=-8WIT-6l6crGnQBlX-z3G6-3mKUsBWsURRyeti1ySmI,4267
|
|
5
|
+
crackerjack/.pre-commit-config.yaml,sha256=VcK0a32l_OjR-b9hkfXS-eSQORBxsS0QyaVQXPz8jOc,3345
|
|
6
|
+
crackerjack/__init__.py,sha256=8tBSPAru_YDuPpjz05cL7pNbZjYFoRT_agGd_FWa3gY,839
|
|
7
|
+
crackerjack/__main__.py,sha256=4BxL6-o1wrfouAgcXd91eInS2FJiEyhT3a6V5ZfnBWU,7082
|
|
8
|
+
crackerjack/crackerjack.py,sha256=5JZKO_CjbTmiQAVDlso7XSkfTWbs-O80H_3UUEjs79o,102989
|
|
9
|
+
crackerjack/errors.py,sha256=Wcv0rXfzV9pHOoXYrhQEjyJd4kUUBbdiY-5M9nI8pDw,4050
|
|
10
|
+
crackerjack/interactive.py,sha256=pFItgRUyjOakABLCRz6nIp6_Ycx2LBSeojpYNiTelv0,16126
|
|
11
|
+
crackerjack/py313.py,sha256=buYE7LO11Q64ffowEhTZRFQoAGj_8sg3DTlZuv8M9eo,5890
|
|
12
|
+
crackerjack/pyproject.toml,sha256=7lWQyzNq4anXZVpfDmIRkJZc3pXso-LbCHAI4rKnZIw,7647
|
|
13
|
+
crackerjack-0.27.0.dist-info/METADATA,sha256=6HxK2bFU_5w-0-Uxr0LVWaCISHmUOSpzsDiV2XITUes,28788
|
|
14
|
+
crackerjack-0.27.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
crackerjack-0.27.0.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
|
16
|
+
crackerjack-0.27.0.dist-info/RECORD,,
|