crackerjack 0.17.4__py3-none-any.whl → 0.18.1__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/__main__.py CHANGED
@@ -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
@@ -796,8 +797,14 @@ class Crackerjack:
796
797
  if options.clean:
797
798
  actions_performed.append("clean_project")
798
799
 
799
- self.project_manager.run_pre_commit()
800
- actions_performed.append("run_pre_commit")
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:
@@ -152,7 +152,7 @@ pythonPlatform = "Darwin"
152
152
 
153
153
  [project]
154
154
  name = "crackerjack"
155
- version = "0.17.3"
155
+ version = "0.18.0"
156
156
  description = "Default template for PDM package"
157
157
  requires-python = ">=3.13"
158
158
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crackerjack
3
- Version: 0.17.4
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 designed to solve common challenges in Python development:
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
- - **Problem**: Setting up Python projects with best practices is time-consuming and requires knowledge of many tools
59
- - **Solution**: Crackerjack automates project setup with pre-configured best practices and tools
58
+ ### Why Choose Crackerjack?
60
59
 
61
- - **Problem**: Maintaining consistent code quality across a project is difficult
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
- - **Problem**: Publishing Python packages involves many manual steps
65
- - **Solution**: Crackerjack streamlines the entire development lifecycle from code cleaning to testing to version bumping to publishing
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
- Crackerjack combines best-in-class tools (Ruff, PDM, pre-commit, pytest, and more) into a single, streamlined workflow to ensure code quality, consistency, and reliability. It's designed for Python developers who want to focus on writing code rather than configuring tools.
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
- Crackerjack provides:
108
-
109
- - **Effortless Project Setup:** Initializes new Python projects with a standard directory structure, `pyproject.toml`, and essential configuration files.
110
- - **PDM Integration:** Manages dependencies and virtual environments using [PDM](https://pdm.fming.dev/) (with [uv](https://github.com/astral-sh/uv) enabled for speed).
111
- - **Automated Code Cleaning:** Removes unnecessary docstrings, line comments, and trailing whitespace.
112
- - **Consistent Code Formatting:** Enforces a consistent style using [Ruff](https://github.com/astral-sh/ruff), the lightning-fast Python linter and formatter.
113
- - **Comprehensive Pre-commit Hooks:** Installs and manages a robust suite of pre-commit hooks to ensure code quality (see the "Pre-commit Hooks" section below).
114
- - **Interactive Checks:** Supports interactive pre-commit hooks (like `refurb`, `bandit`, and `pyright`) to allow you to fix issues in real-time.
115
- - **Built-in Testing:** Automatically runs tests using `pytest`.
116
- - **Easy Version Bumping:** Provides commands to bump the project version (micro, minor, or major).
117
- - **Simplified Publishing:** Automates publishing to PyPI via PDM.
118
- - **Commit and Push:** Commits and pushes your changes.
119
- - **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab.
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
- self.commit = False
195
- self.interactive = True
196
- self.doc = False
197
- self.no_config_updates = False
198
- self.verbose = True
199
- self.update_precommit = False
200
- self.clean = True
201
- self.test = True
202
- self.publish = None
203
- self.bump = "micro"
204
- self.all = None
205
- self.create_pr = False
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
- - **Run checks, bump version, publish, then commit:**
239
- ```
240
- python -m crackerjack -p minor -c
241
- ```
274
+ #### Development Workflows
242
275
 
243
- - **Clean code, run checks, run tests, then commit:**
244
- ```
245
- python -m crackerjack -c -x -t
246
- ```
276
+ - **Quick Check** - Run basic checks on your code:
277
+ ```bash
278
+ python -m crackerjack
279
+ ```
247
280
 
248
- - **Run checks skipping config updates:**
249
- ```
250
- python -m crackerjack -n
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
- - **Bump the version and publish to PyPI:**
254
- ```
255
- python -m crackerjack -p micro
256
- ```
285
+ # Equivalent to:
286
+ python -m crackerjack -x -t -p minor -c
287
+ ```
257
288
 
258
- - **Bump the version without publishing:**
259
- ```
260
- python -m crackerjack -b major
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
- - **Update pre-commit hooks:**
264
- ```
265
- python -m crackerjack -u
266
- ```
294
+ - **Fast Testing** - Run tests without running pre-commit hooks:
295
+ ```bash
296
+ python -m crackerjack -t -s
297
+ ```
267
298
 
268
- - **Create a pull request to the upstream repository:**
269
- ```
270
- python -m crackerjack -r
271
- ```
299
+ #### Version Management
272
300
 
273
- - **Get help:**
274
- ```
275
- python -m crackerjack --help
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
- - **Clean code, run checks, run tests, bump version, publish, then commit:**
279
- ```
280
- python -m crackerjack -x -t -p minor -c
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
- # or even easier
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
- python -m crackerjack -a minor
349
+ - **Help** - Display command help:
350
+ ```bash
351
+ python -m crackerjack --help
285
352
  ```
286
353
 
287
354
  ## AI Agent Integration
@@ -1,7 +1,7 @@
1
- crackerjack-0.17.4.dist-info/METADATA,sha256=bW0Yvde4y71GqZPfsiEf3LxR7NMKiGv5gyuGAOw-5RU,14872
2
- crackerjack-0.17.4.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- crackerjack-0.17.4.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- crackerjack-0.17.4.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
1
+ crackerjack-0.18.1.dist-info/METADATA,sha256=n7uXNTLnzmO9c__WFDUjM2tXnCUkKU-PvkReWmHzykY,17747
2
+ crackerjack-0.18.1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ crackerjack-0.18.1.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ crackerjack-0.18.1.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
5
5
  crackerjack/.gitignore,sha256=oho3dNx7a7y36_y9AsalCkssU4in0MMsNAANWdc-h1c,153
6
6
  crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
7
7
  crackerjack/.pdm.toml,sha256=dZe44HRcuxxCFESGG8SZIjmc-cGzSoyK3Hs6t4NYA8w,23
@@ -24,7 +24,7 @@ crackerjack/.ruff_cache/0.11.4/9818742842212983150,sha256=QF9j6-3MH_d0pDNotdbF2h
24
24
  crackerjack/.ruff_cache/0.11.6/3557596832929915217,sha256=yR2iXWDkSHVRw2eTiaCE8Eh34JPRUGc8vE3HYEEBk9k,224
25
25
  crackerjack/.ruff_cache/0.11.7/10386934055395314831,sha256=lBNwN5zAgM4OzbkXIOzCczUtfooATrD10htj9ASlFkc,224
26
26
  crackerjack/.ruff_cache/0.11.7/3557596832929915217,sha256=fKlwUbsvT3YIKV6UR-aA_i64lLignWeVfVu-MMmVbU0,207
27
- crackerjack/.ruff_cache/0.11.8/530407680854991027,sha256=90qTTPHgVDIxJ01G4UyG1DEB9L-rFuGm95sPViH-MRw,224
27
+ crackerjack/.ruff_cache/0.11.8/530407680854991027,sha256=G5OzHZdMbB_wqFgzzKInpUDR2v19Qj2w8EdWm8zlR88,224
28
28
  crackerjack/.ruff_cache/0.2.0/10047773857155985907,sha256=j9LNa_RQ4Plor7go1uTYgz17cEENKvZQ-dP6b9MX0ik,248
29
29
  crackerjack/.ruff_cache/0.2.1/8522267973936635051,sha256=u_aPBMibtAp_iYvLwR88GMAECMcIgHezxMyuapmU2P4,248
30
30
  crackerjack/.ruff_cache/0.2.2/18053836298936336950,sha256=Xb_ebP0pVuUfSqPEZKlhQ70so_vqkEfMYpuHQ06iR5U,248
@@ -53,7 +53,7 @@ crackerjack/.ruff_cache/0.9.9/12813592349865671909,sha256=tmr8_vhRD2OxsVuMfbJPdT
53
53
  crackerjack/.ruff_cache/0.9.9/8843823720003377982,sha256=e4ymkXfQsUg5e_mtO34xTsaTvs1uA3_fI216Qq9qCAM,136
54
54
  crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
55
55
  crackerjack/__init__.py,sha256=r9SuEjHUrW99hFWifRk4ofmYPSgf9rblcnzqhdV5bP0,157
56
- crackerjack/__main__.py,sha256=O2BZxkwH8FKIhQJyWEaLAxvFT2pRGSyr4J7nXpDKV9U,4291
57
- crackerjack/crackerjack.py,sha256=oXPPnyKyd205QYwxVvQI3-fA4iF3i69XVJpChhmlTV8,33246
58
- crackerjack/pyproject.toml,sha256=ionKxBo9Kg_nKc5en_Bb5jssO5UQ7TCtbwE-ZIocATM,4199
59
- crackerjack-0.17.4.dist-info/RECORD,,
56
+ crackerjack/__main__.py,sha256=FDAcn9NYoQ7q01YDtdxUgKz3RloItUc-Z8x5kBGcemA,4557
57
+ crackerjack/crackerjack.py,sha256=07yDkbj0ChR5hnqTC6zJw5Bx9YuP9cQad6G3Jbq9OyE,33512
58
+ crackerjack/pyproject.toml,sha256=zb6cU5lId5Qmh0Xl-gHt-sMeuB-ROmeVRUj_3ikra94,4199
59
+ crackerjack-0.18.1.dist-info/RECORD,,