crackerjack 0.18.0__tar.gz → 0.18.1__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.18.0 → crackerjack-0.18.1}/PKG-INFO +141 -74
- {crackerjack-0.18.0 → crackerjack-0.18.1}/README.md +140 -73
- crackerjack-0.18.1/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/pyproject.toml +1 -1
- {crackerjack-0.18.0 → crackerjack-0.18.1}/pyproject.toml +1 -1
- crackerjack-0.18.0/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/LICENSE +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.gitignore +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.libcst.codemod.yaml +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pdm.toml +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pre-commit-config.yaml +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pytest_cache/.gitignore +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pytest_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pytest_cache/README.md +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pytest_cache/v/cache/nodeids +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.pytest_cache/v/cache/stepwise +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/.gitignore +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.11/3256171999636029978 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.14/602324811142551221 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.4/10355199064880463147 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.6/15140459877605758699 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.7/1790508110482614856 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.9/17041001205004563469 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.2/4070660268492669020 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.3/9818742842212983150 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.4/9818742842212983150 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.6/3557596832929915217 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.7/10386934055395314831 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.7/3557596832929915217 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.2.0/10047773857155985907 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.2.1/8522267973936635051 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.2.2/18053836298936336950 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.0/12548816621480535786 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.3/11081883392474770722 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.4/676973378459347183 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.5/16311176246009842383 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.5.7/1493622539551733492 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.5.7/6231957614044513175 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.5.7/9932762556785938009 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.0/11982804814124138945 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.4/1206147804896221174 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.5/1206147804896221174 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.7/3657366982708166874 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.9/285614542852677309 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.7.1/1024065805990144819 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.7.1/285614542852677309 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.7.3/16061516852537040135 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.8.4/16354268377385700367 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.10/923908772239632759 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.3/13948373885254993391 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.9/12813592349865671909 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.9/8843823720003377982 +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/__init__.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/__main__.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/crackerjack.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/README.md +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/__init__.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/data/comments_sample.txt +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/data/docstrings_sample.txt +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/data/expected_comments_sample.txt +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/data/init.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/test_crackerjack.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/test_crackerjack_runner.py +0 -0
- {crackerjack-0.18.0 → crackerjack-0.18.1}/tests/test_main.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: crackerjack
|
3
|
-
Version: 0.18.
|
3
|
+
Version: 0.18.1
|
4
4
|
Summary: Default template for PDM package
|
5
5
|
Keywords: black,ruff,mypy,creosote,refurb
|
6
6
|
Author-Email: lesleslie <les@wedgwoodwebworks.com>
|
@@ -53,18 +53,25 @@ Description-Content-Type: text/markdown
|
|
53
53
|
|
54
54
|
## What is Crackerjack?
|
55
55
|
|
56
|
-
Crackerjack is an opinionated Python project management tool
|
56
|
+
Crackerjack is an opinionated Python project management tool that streamlines the entire development lifecycle. It combines best-in-class tools into a unified workflow, allowing you to focus on writing code rather than configuring tools.
|
57
57
|
|
58
|
-
|
59
|
-
- **Solution**: Crackerjack automates project setup with pre-configured best practices and tools
|
58
|
+
### Why Choose Crackerjack?
|
60
59
|
|
61
|
-
|
62
|
-
- **Solution**: Crackerjack enforces a consistent style and quality standard through integrated linting, formatting, and pre-commit hooks
|
60
|
+
Crackerjack solves three critical challenges in Python development:
|
63
61
|
|
64
|
-
|
65
|
-
- **
|
62
|
+
1. **Project Setup & Configuration**
|
63
|
+
- **Challenge**: Setting up Python projects with best practices requires knowledge of numerous tools and configurations
|
64
|
+
- **Solution**: Crackerjack automates project initialization with pre-configured templates and industry best practices
|
66
65
|
|
67
|
-
|
66
|
+
2. **Code Quality & Consistency**
|
67
|
+
- **Challenge**: Maintaining consistent code quality across a project and team requires constant vigilance
|
68
|
+
- **Solution**: Crackerjack enforces a unified style through integrated linting, formatting, and pre-commit hooks
|
69
|
+
|
70
|
+
3. **Streamlined Publishing**
|
71
|
+
- **Challenge**: Publishing Python packages involves many manual, error-prone steps
|
72
|
+
- **Solution**: Crackerjack automates the entire release process from testing to version bumping to publishing
|
73
|
+
|
74
|
+
Crackerjack integrates powerful tools like Ruff, PDM, 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.
|
68
75
|
|
69
76
|
---
|
70
77
|
|
@@ -104,19 +111,33 @@ Crackerjack is built on the following core principles:
|
|
104
111
|
|
105
112
|
## Key Features
|
106
113
|
|
107
|
-
|
108
|
-
|
109
|
-
-
|
110
|
-
-
|
111
|
-
|
112
|
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
117
|
-
-
|
118
|
-
|
119
|
-
|
114
|
+
### Project Management
|
115
|
+
- **Effortless Project Setup:** Initializes new Python projects with a standard directory structure, `pyproject.toml`, and essential configuration files
|
116
|
+
- **PDM Integration:** Manages dependencies and virtual environments using [PDM](https://pdm.fming.dev/) with [uv](https://github.com/astral-sh/uv) for lightning-fast package operations
|
117
|
+
- **Dependency Management:** Automatically detects and manages project dependencies
|
118
|
+
|
119
|
+
### Code Quality
|
120
|
+
- **Automated Code Cleaning:** Removes unnecessary docstrings, line comments, and trailing whitespace
|
121
|
+
- **Consistent Code Formatting:** Enforces a unified style using [Ruff](https://github.com/astral-sh/ruff), the lightning-fast Python linter and formatter
|
122
|
+
- **Comprehensive Pre-commit Hooks:** Installs and manages a robust suite of pre-commit hooks (see the "Pre-commit Hooks" section below)
|
123
|
+
- **Interactive Checks:** Supports interactive pre-commit hooks (like `refurb`, `bandit`, and `pyright`) to fix issues in real-time
|
124
|
+
- **Static Type Checking:** Enforces type safety with Pyright integration
|
125
|
+
|
126
|
+
### Testing & Deployment
|
127
|
+
- **Built-in Testing:** Automatically runs tests using `pytest`
|
128
|
+
- **Easy Version Bumping:** Provides commands to bump the project version (micro, minor, or major)
|
129
|
+
- **Simplified Publishing:** Automates publishing to PyPI via PDM
|
130
|
+
|
131
|
+
### Git Integration
|
132
|
+
- **Commit and Push:** Commits and pushes your changes with standardized commit messages
|
133
|
+
- **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab
|
134
|
+
- **Pre-commit Integration:** Ensures code quality before commits
|
135
|
+
|
136
|
+
### Developer Experience
|
137
|
+
- **Command-Line Interface:** Simple, intuitive CLI with comprehensive options
|
138
|
+
- **Programmatic API:** Can be integrated into your own Python scripts and workflows
|
139
|
+
- **AI Agent Integration:** Structured output format for integration with AI assistants
|
140
|
+
- **Verbose Mode:** Detailed output for debugging and understanding what's happening
|
120
141
|
|
121
142
|
## Pre-commit Hooks
|
122
143
|
|
@@ -191,24 +212,38 @@ from crackerjack import create_crackerjack_runner
|
|
191
212
|
# Create a custom options object
|
192
213
|
class MyOptions:
|
193
214
|
def __init__(self):
|
194
|
-
|
195
|
-
self.
|
196
|
-
self.
|
197
|
-
self.
|
198
|
-
|
199
|
-
|
200
|
-
self.
|
201
|
-
self.
|
202
|
-
self.
|
203
|
-
|
204
|
-
|
205
|
-
self.
|
215
|
+
# Core options
|
216
|
+
self.commit = False # Commit changes to Git
|
217
|
+
self.interactive = True # Run pre-commit hooks interactively
|
218
|
+
self.verbose = True # Enable verbose output
|
219
|
+
|
220
|
+
# Configuration options
|
221
|
+
self.no_config_updates = False # Skip updating config files
|
222
|
+
self.update_precommit = False # Update pre-commit hooks
|
223
|
+
self.doc = False # Generate documentation (not implemented yet)
|
224
|
+
|
225
|
+
# Process options
|
226
|
+
self.clean = True # Clean code (remove docstrings, comments, etc.)
|
227
|
+
self.test = True # Run tests using pytest
|
228
|
+
self.skip_hooks = False # Skip running pre-commit hooks
|
229
|
+
|
230
|
+
# Version and publishing options
|
231
|
+
self.publish = None # Publish to PyPI (micro, minor, major)
|
232
|
+
self.bump = "micro" # Bump version (micro, minor, major)
|
233
|
+
self.all = None # Run with -x -t -p <version> -c
|
234
|
+
|
235
|
+
# Git options
|
236
|
+
self.create_pr = False # Create a pull request
|
237
|
+
|
238
|
+
# Integration options
|
239
|
+
self.ai_agent = False # Enable AI agent structured output
|
206
240
|
|
207
241
|
# Create a Crackerjack runner with custom settings
|
208
242
|
runner = create_crackerjack_runner(
|
209
|
-
console=Console(force_terminal=True),
|
210
|
-
pkg_path=Path.cwd(),
|
211
|
-
python_version="3.13"
|
243
|
+
console=Console(force_terminal=True), # Rich console for pretty output
|
244
|
+
pkg_path=Path.cwd(), # Path to your project
|
245
|
+
python_version="3.13", # Target Python version
|
246
|
+
dry_run=False # Set to True to simulate without changes
|
212
247
|
)
|
213
248
|
|
214
249
|
# Run Crackerjack with your options
|
@@ -227,6 +262,7 @@ runner.process(MyOptions())
|
|
227
262
|
- `-p`, `--publish <micro|minor|major>`: Bump the project version and publish to PyPI using PDM.
|
228
263
|
- `-b`, `--bump <micro|minor|major>`: Bump the project version without publishing.
|
229
264
|
- `-r`, `--pr`: Create a pull request to the upstream repository.
|
265
|
+
- `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`).
|
230
266
|
- `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
|
231
267
|
- `-t`, `--test`: Run tests using `pytest`.
|
232
268
|
- `-a`, `--all`: Run with `-x -t -p <micro|minor|major> -c` development options.
|
@@ -235,53 +271,84 @@ runner.process(MyOptions())
|
|
235
271
|
|
236
272
|
### Example Workflows
|
237
273
|
|
238
|
-
|
239
|
-
```
|
240
|
-
python -m crackerjack -p minor -c
|
241
|
-
```
|
274
|
+
#### Development Workflows
|
242
275
|
|
243
|
-
-
|
244
|
-
|
245
|
-
|
246
|
-
|
276
|
+
- **Quick Check** - Run basic checks on your code:
|
277
|
+
```bash
|
278
|
+
python -m crackerjack
|
279
|
+
```
|
247
280
|
|
248
|
-
-
|
249
|
-
|
250
|
-
|
251
|
-
```
|
281
|
+
- **Full Development Cycle** - Clean, test, bump version, publish, and commit:
|
282
|
+
```bash
|
283
|
+
python -m crackerjack -a minor # All-in-one command
|
252
284
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
```
|
285
|
+
# Equivalent to:
|
286
|
+
python -m crackerjack -x -t -p minor -c
|
287
|
+
```
|
257
288
|
|
258
|
-
-
|
259
|
-
|
260
|
-
|
261
|
-
|
289
|
+
- **Development with Tests** - Clean code, run checks, run tests, then commit:
|
290
|
+
```bash
|
291
|
+
python -m crackerjack -c -x -t
|
292
|
+
```
|
262
293
|
|
263
|
-
- **
|
264
|
-
|
265
|
-
|
266
|
-
|
294
|
+
- **Fast Testing** - Run tests without running pre-commit hooks:
|
295
|
+
```bash
|
296
|
+
python -m crackerjack -t -s
|
297
|
+
```
|
267
298
|
|
268
|
-
|
269
|
-
```
|
270
|
-
python -m crackerjack -r
|
271
|
-
```
|
299
|
+
#### Version Management
|
272
300
|
|
273
|
-
- **
|
274
|
-
|
275
|
-
|
276
|
-
|
301
|
+
- **Bump and Publish** - Bump version and publish to PyPI:
|
302
|
+
```bash
|
303
|
+
python -m crackerjack -p micro # For patch version
|
304
|
+
python -m crackerjack -p minor # For minor version
|
305
|
+
python -m crackerjack -p major # For major version
|
306
|
+
```
|
277
307
|
|
278
|
-
- **
|
279
|
-
|
280
|
-
python -m crackerjack -
|
308
|
+
- **Version Bump Only** - Bump version without publishing:
|
309
|
+
```bash
|
310
|
+
python -m crackerjack -b major
|
311
|
+
```
|
312
|
+
|
313
|
+
#### Configuration Management
|
314
|
+
|
315
|
+
- **Skip Config Updates** - Run checks without updating configuration files:
|
316
|
+
```bash
|
317
|
+
python -m crackerjack -n
|
318
|
+
```
|
281
319
|
|
282
|
-
|
320
|
+
- **Update Hooks** - Update pre-commit hooks to latest versions:
|
321
|
+
```bash
|
322
|
+
python -m crackerjack -u
|
323
|
+
```
|
324
|
+
|
325
|
+
#### Git Operations
|
326
|
+
|
327
|
+
- **Commit Changes** - Run checks and commit changes:
|
328
|
+
```bash
|
329
|
+
python -m crackerjack -c
|
330
|
+
```
|
331
|
+
|
332
|
+
- **Create PR** - Create a pull request to the upstream repository:
|
333
|
+
```bash
|
334
|
+
python -m crackerjack -r
|
335
|
+
```
|
336
|
+
|
337
|
+
#### Other Operations
|
338
|
+
|
339
|
+
- **Interactive Mode** - Run pre-commit hooks interactively:
|
340
|
+
```bash
|
341
|
+
python -m crackerjack -i
|
342
|
+
```
|
343
|
+
|
344
|
+
- **AI Integration** - Run with structured output for AI tools:
|
345
|
+
```bash
|
346
|
+
python -m crackerjack --ai-agent --test
|
347
|
+
```
|
283
348
|
|
284
|
-
|
349
|
+
- **Help** - Display command help:
|
350
|
+
```bash
|
351
|
+
python -m crackerjack --help
|
285
352
|
```
|
286
353
|
|
287
354
|
## AI Agent Integration
|
@@ -13,18 +13,25 @@
|
|
13
13
|
|
14
14
|
## What is Crackerjack?
|
15
15
|
|
16
|
-
Crackerjack is an opinionated Python project management tool
|
16
|
+
Crackerjack is an opinionated Python project management tool that streamlines the entire development lifecycle. It combines best-in-class tools into a unified workflow, allowing you to focus on writing code rather than configuring tools.
|
17
17
|
|
18
|
-
|
19
|
-
- **Solution**: Crackerjack automates project setup with pre-configured best practices and tools
|
18
|
+
### Why Choose Crackerjack?
|
20
19
|
|
21
|
-
|
22
|
-
- **Solution**: Crackerjack enforces a consistent style and quality standard through integrated linting, formatting, and pre-commit hooks
|
20
|
+
Crackerjack solves three critical challenges in Python development:
|
23
21
|
|
24
|
-
|
25
|
-
- **
|
22
|
+
1. **Project Setup & Configuration**
|
23
|
+
- **Challenge**: Setting up Python projects with best practices requires knowledge of numerous tools and configurations
|
24
|
+
- **Solution**: Crackerjack automates project initialization with pre-configured templates and industry best practices
|
26
25
|
|
27
|
-
|
26
|
+
2. **Code Quality & Consistency**
|
27
|
+
- **Challenge**: Maintaining consistent code quality across a project and team requires constant vigilance
|
28
|
+
- **Solution**: Crackerjack enforces a unified style through integrated linting, formatting, and pre-commit hooks
|
29
|
+
|
30
|
+
3. **Streamlined Publishing**
|
31
|
+
- **Challenge**: Publishing Python packages involves many manual, error-prone steps
|
32
|
+
- **Solution**: Crackerjack automates the entire release process from testing to version bumping to publishing
|
33
|
+
|
34
|
+
Crackerjack integrates powerful tools like Ruff, PDM, 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.
|
28
35
|
|
29
36
|
---
|
30
37
|
|
@@ -64,19 +71,33 @@ Crackerjack is built on the following core principles:
|
|
64
71
|
|
65
72
|
## Key Features
|
66
73
|
|
67
|
-
|
68
|
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
|
72
|
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
|
79
|
-
|
74
|
+
### Project Management
|
75
|
+
- **Effortless Project Setup:** Initializes new Python projects with a standard directory structure, `pyproject.toml`, and essential configuration files
|
76
|
+
- **PDM Integration:** Manages dependencies and virtual environments using [PDM](https://pdm.fming.dev/) with [uv](https://github.com/astral-sh/uv) for lightning-fast package operations
|
77
|
+
- **Dependency Management:** Automatically detects and manages project dependencies
|
78
|
+
|
79
|
+
### Code Quality
|
80
|
+
- **Automated Code Cleaning:** Removes unnecessary docstrings, line comments, and trailing whitespace
|
81
|
+
- **Consistent Code Formatting:** Enforces a unified style using [Ruff](https://github.com/astral-sh/ruff), the lightning-fast Python linter and formatter
|
82
|
+
- **Comprehensive Pre-commit Hooks:** Installs and manages a robust suite of pre-commit hooks (see the "Pre-commit Hooks" section below)
|
83
|
+
- **Interactive Checks:** Supports interactive pre-commit hooks (like `refurb`, `bandit`, and `pyright`) to fix issues in real-time
|
84
|
+
- **Static Type Checking:** Enforces type safety with Pyright integration
|
85
|
+
|
86
|
+
### Testing & Deployment
|
87
|
+
- **Built-in Testing:** Automatically runs tests using `pytest`
|
88
|
+
- **Easy Version Bumping:** Provides commands to bump the project version (micro, minor, or major)
|
89
|
+
- **Simplified Publishing:** Automates publishing to PyPI via PDM
|
90
|
+
|
91
|
+
### Git Integration
|
92
|
+
- **Commit and Push:** Commits and pushes your changes with standardized commit messages
|
93
|
+
- **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab
|
94
|
+
- **Pre-commit Integration:** Ensures code quality before commits
|
95
|
+
|
96
|
+
### Developer Experience
|
97
|
+
- **Command-Line Interface:** Simple, intuitive CLI with comprehensive options
|
98
|
+
- **Programmatic API:** Can be integrated into your own Python scripts and workflows
|
99
|
+
- **AI Agent Integration:** Structured output format for integration with AI assistants
|
100
|
+
- **Verbose Mode:** Detailed output for debugging and understanding what's happening
|
80
101
|
|
81
102
|
## Pre-commit Hooks
|
82
103
|
|
@@ -151,24 +172,38 @@ from crackerjack import create_crackerjack_runner
|
|
151
172
|
# Create a custom options object
|
152
173
|
class MyOptions:
|
153
174
|
def __init__(self):
|
154
|
-
|
155
|
-
self.
|
156
|
-
self.
|
157
|
-
self.
|
158
|
-
|
159
|
-
|
160
|
-
self.
|
161
|
-
self.
|
162
|
-
self.
|
163
|
-
|
164
|
-
|
165
|
-
self.
|
175
|
+
# Core options
|
176
|
+
self.commit = False # Commit changes to Git
|
177
|
+
self.interactive = True # Run pre-commit hooks interactively
|
178
|
+
self.verbose = True # Enable verbose output
|
179
|
+
|
180
|
+
# Configuration options
|
181
|
+
self.no_config_updates = False # Skip updating config files
|
182
|
+
self.update_precommit = False # Update pre-commit hooks
|
183
|
+
self.doc = False # Generate documentation (not implemented yet)
|
184
|
+
|
185
|
+
# Process options
|
186
|
+
self.clean = True # Clean code (remove docstrings, comments, etc.)
|
187
|
+
self.test = True # Run tests using pytest
|
188
|
+
self.skip_hooks = False # Skip running pre-commit hooks
|
189
|
+
|
190
|
+
# Version and publishing options
|
191
|
+
self.publish = None # Publish to PyPI (micro, minor, major)
|
192
|
+
self.bump = "micro" # Bump version (micro, minor, major)
|
193
|
+
self.all = None # Run with -x -t -p <version> -c
|
194
|
+
|
195
|
+
# Git options
|
196
|
+
self.create_pr = False # Create a pull request
|
197
|
+
|
198
|
+
# Integration options
|
199
|
+
self.ai_agent = False # Enable AI agent structured output
|
166
200
|
|
167
201
|
# Create a Crackerjack runner with custom settings
|
168
202
|
runner = create_crackerjack_runner(
|
169
|
-
console=Console(force_terminal=True),
|
170
|
-
pkg_path=Path.cwd(),
|
171
|
-
python_version="3.13"
|
203
|
+
console=Console(force_terminal=True), # Rich console for pretty output
|
204
|
+
pkg_path=Path.cwd(), # Path to your project
|
205
|
+
python_version="3.13", # Target Python version
|
206
|
+
dry_run=False # Set to True to simulate without changes
|
172
207
|
)
|
173
208
|
|
174
209
|
# Run Crackerjack with your options
|
@@ -187,6 +222,7 @@ runner.process(MyOptions())
|
|
187
222
|
- `-p`, `--publish <micro|minor|major>`: Bump the project version and publish to PyPI using PDM.
|
188
223
|
- `-b`, `--bump <micro|minor|major>`: Bump the project version without publishing.
|
189
224
|
- `-r`, `--pr`: Create a pull request to the upstream repository.
|
225
|
+
- `-s`, `--skip-hooks`: Skip running pre-commit hooks (useful with `-t`).
|
190
226
|
- `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
|
191
227
|
- `-t`, `--test`: Run tests using `pytest`.
|
192
228
|
- `-a`, `--all`: Run with `-x -t -p <micro|minor|major> -c` development options.
|
@@ -195,53 +231,84 @@ runner.process(MyOptions())
|
|
195
231
|
|
196
232
|
### Example Workflows
|
197
233
|
|
198
|
-
|
199
|
-
```
|
200
|
-
python -m crackerjack -p minor -c
|
201
|
-
```
|
234
|
+
#### Development Workflows
|
202
235
|
|
203
|
-
-
|
204
|
-
|
205
|
-
|
206
|
-
|
236
|
+
- **Quick Check** - Run basic checks on your code:
|
237
|
+
```bash
|
238
|
+
python -m crackerjack
|
239
|
+
```
|
207
240
|
|
208
|
-
-
|
209
|
-
|
210
|
-
|
211
|
-
```
|
241
|
+
- **Full Development Cycle** - Clean, test, bump version, publish, and commit:
|
242
|
+
```bash
|
243
|
+
python -m crackerjack -a minor # All-in-one command
|
212
244
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
```
|
245
|
+
# Equivalent to:
|
246
|
+
python -m crackerjack -x -t -p minor -c
|
247
|
+
```
|
217
248
|
|
218
|
-
-
|
219
|
-
|
220
|
-
|
221
|
-
|
249
|
+
- **Development with Tests** - Clean code, run checks, run tests, then commit:
|
250
|
+
```bash
|
251
|
+
python -m crackerjack -c -x -t
|
252
|
+
```
|
222
253
|
|
223
|
-
- **
|
224
|
-
|
225
|
-
|
226
|
-
|
254
|
+
- **Fast Testing** - Run tests without running pre-commit hooks:
|
255
|
+
```bash
|
256
|
+
python -m crackerjack -t -s
|
257
|
+
```
|
227
258
|
|
228
|
-
|
229
|
-
```
|
230
|
-
python -m crackerjack -r
|
231
|
-
```
|
259
|
+
#### Version Management
|
232
260
|
|
233
|
-
- **
|
234
|
-
|
235
|
-
|
236
|
-
|
261
|
+
- **Bump and Publish** - Bump version and publish to PyPI:
|
262
|
+
```bash
|
263
|
+
python -m crackerjack -p micro # For patch version
|
264
|
+
python -m crackerjack -p minor # For minor version
|
265
|
+
python -m crackerjack -p major # For major version
|
266
|
+
```
|
237
267
|
|
238
|
-
- **
|
239
|
-
|
240
|
-
python -m crackerjack -
|
268
|
+
- **Version Bump Only** - Bump version without publishing:
|
269
|
+
```bash
|
270
|
+
python -m crackerjack -b major
|
271
|
+
```
|
272
|
+
|
273
|
+
#### Configuration Management
|
274
|
+
|
275
|
+
- **Skip Config Updates** - Run checks without updating configuration files:
|
276
|
+
```bash
|
277
|
+
python -m crackerjack -n
|
278
|
+
```
|
241
279
|
|
242
|
-
|
280
|
+
- **Update Hooks** - Update pre-commit hooks to latest versions:
|
281
|
+
```bash
|
282
|
+
python -m crackerjack -u
|
283
|
+
```
|
284
|
+
|
285
|
+
#### Git Operations
|
286
|
+
|
287
|
+
- **Commit Changes** - Run checks and commit changes:
|
288
|
+
```bash
|
289
|
+
python -m crackerjack -c
|
290
|
+
```
|
291
|
+
|
292
|
+
- **Create PR** - Create a pull request to the upstream repository:
|
293
|
+
```bash
|
294
|
+
python -m crackerjack -r
|
295
|
+
```
|
296
|
+
|
297
|
+
#### Other Operations
|
298
|
+
|
299
|
+
- **Interactive Mode** - Run pre-commit hooks interactively:
|
300
|
+
```bash
|
301
|
+
python -m crackerjack -i
|
302
|
+
```
|
303
|
+
|
304
|
+
- **AI Integration** - Run with structured output for AI tools:
|
305
|
+
```bash
|
306
|
+
python -m crackerjack --ai-agent --test
|
307
|
+
```
|
243
308
|
|
244
|
-
|
309
|
+
- **Help** - Display command help:
|
310
|
+
```bash
|
311
|
+
python -m crackerjack --help
|
245
312
|
```
|
246
313
|
|
247
314
|
## AI Agent Integration
|
Binary file
|
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
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.11/3256171999636029978
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.4/10355199064880463147
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.6/15140459877605758699
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.1.9/17041001205004563469
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.2/4070660268492669020
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.3/9818742842212983150
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.4/9818742842212983150
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.6/3557596832929915217
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.7/10386934055395314831
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.11.7/3557596832929915217
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.2.0/10047773857155985907
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.2.2/18053836298936336950
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.0/12548816621480535786
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.3/11081883392474770722
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.3.5/16311176246009842383
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.6.0/11982804814124138945
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/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.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.7.3/16061516852537040135
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.8.4/16354268377385700367
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.10/12813592349865671909
RENAMED
File without changes
|
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/crackerjack/.ruff_cache/0.9.3/13948373885254993391
RENAMED
File without changes
|
{crackerjack-0.18.0 → crackerjack-0.18.1}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|