crackerjack 0.12.1__py3-none-any.whl → 0.13.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.
- crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
- crackerjack/__init__.py +0 -1
- crackerjack/__main__.py +10 -1
- crackerjack/crackerjack.py +9 -6
- crackerjack/pyproject.toml +1 -1
- {crackerjack-0.12.1.dist-info → crackerjack-0.13.0.dist-info}/METADATA +47 -8
- {crackerjack-0.12.1.dist-info → crackerjack-0.13.0.dist-info}/RECORD +10 -10
- {crackerjack-0.12.1.dist-info → crackerjack-0.13.0.dist-info}/WHEEL +0 -0
- {crackerjack-0.12.1.dist-info → crackerjack-0.13.0.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.12.1.dist-info → crackerjack-0.13.0.dist-info}/licenses/LICENSE +0 -0
Binary file
|
crackerjack/__init__.py
CHANGED
crackerjack/__main__.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import typing as t
|
2
2
|
from enum import Enum
|
3
|
-
|
4
3
|
import typer
|
5
4
|
from pydantic import BaseModel, field_validator
|
6
5
|
from rich.console import Console
|
@@ -32,6 +31,7 @@ class Options(BaseModel):
|
|
32
31
|
update_precommit: bool = False
|
33
32
|
clean: bool = False
|
34
33
|
test: bool = False
|
34
|
+
all: t.Optional[BumpOption] = None
|
35
35
|
|
36
36
|
@classmethod
|
37
37
|
@field_validator("publish", "bump", mode="before")
|
@@ -81,6 +81,13 @@ cli_options = {
|
|
81
81
|
help="Remove docstrings, line comments, and unnecessary whitespace.",
|
82
82
|
),
|
83
83
|
"test": typer.Option(False, "-t", "--test", help="Run tests."),
|
84
|
+
"all": typer.Option(
|
85
|
+
None,
|
86
|
+
"-a",
|
87
|
+
"--all",
|
88
|
+
help="Run with `-x -t -p <micro|minor|major> -c` development options).",
|
89
|
+
case_sensitive=False,
|
90
|
+
),
|
84
91
|
}
|
85
92
|
|
86
93
|
|
@@ -97,6 +104,7 @@ def main(
|
|
97
104
|
update_precommit: bool = cli_options["update_precommit"],
|
98
105
|
verbose: bool = cli_options["verbose"],
|
99
106
|
publish: t.Optional[BumpOption] = cli_options["publish"],
|
107
|
+
all: t.Optional[BumpOption] = cli_options["all"],
|
100
108
|
bump: t.Optional[BumpOption] = cli_options["bump"],
|
101
109
|
clean: bool = cli_options["clean"],
|
102
110
|
test: bool = cli_options["test"],
|
@@ -112,6 +120,7 @@ def main(
|
|
112
120
|
bump=bump,
|
113
121
|
clean=clean,
|
114
122
|
test=test,
|
123
|
+
all=all,
|
115
124
|
)
|
116
125
|
crackerjack_it(options)
|
117
126
|
|
crackerjack/crackerjack.py
CHANGED
@@ -8,7 +8,6 @@ from pathlib import Path
|
|
8
8
|
from subprocess import CompletedProcess
|
9
9
|
from subprocess import run as execute
|
10
10
|
from tomllib import loads
|
11
|
-
|
12
11
|
from pydantic import BaseModel
|
13
12
|
from rich.console import Console
|
14
13
|
from tomli_w import dumps
|
@@ -369,11 +368,10 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
369
368
|
if options.clean:
|
370
369
|
if self.pkg_dir:
|
371
370
|
self.code_cleaner.clean_files(self.pkg_dir)
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
self.code_cleaner.clean_files(tests_dir)
|
371
|
+
tests_dir = self.pkg_path / "tests"
|
372
|
+
if tests_dir.exists() and tests_dir.is_dir():
|
373
|
+
self.console.print("\nCleaning tests directory...\n")
|
374
|
+
self.code_cleaner.clean_files(tests_dir)
|
377
375
|
|
378
376
|
def _run_tests(self, options: t.Any) -> None:
|
379
377
|
if options.test:
|
@@ -432,6 +430,11 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
432
430
|
return execute(cmd, **kwargs)
|
433
431
|
|
434
432
|
def process(self, options: t.Any) -> None:
|
433
|
+
if options.all:
|
434
|
+
options.clean = True
|
435
|
+
options.test = True
|
436
|
+
options.publish = options.all
|
437
|
+
options.commit = True
|
435
438
|
self._setup_package()
|
436
439
|
self._update_project(options)
|
437
440
|
self._update_precommit(options)
|
crackerjack/pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: crackerjack
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.13.0
|
4
4
|
Summary: Default template for PDM package
|
5
5
|
Keywords: black,ruff,mypy,creosote,refurb
|
6
6
|
Author-Email: lesleslie <les@wedgwoodwebworks.com>
|
@@ -52,6 +52,31 @@ Description-Content-Type: text/markdown
|
|
52
52
|
|
53
53
|
Crackerjack is an opinionated Python project management tool designed to help you create, maintain, and publish high-quality Python projects with ease. It combines best-in-class tools and a streamlined workflow to ensure code quality, consistency, and reliability.
|
54
54
|
|
55
|
+
---
|
56
|
+
|
57
|
+
## Getting Started
|
58
|
+
|
59
|
+
### Quick Start
|
60
|
+
|
61
|
+
If you're new to Crackerjack, follow these steps:
|
62
|
+
1. **Install Python 3.13:** Ensure you have Python 3.13 installed.
|
63
|
+
2. **Install PDM:**
|
64
|
+
```
|
65
|
+
pipx install pdm
|
66
|
+
```
|
67
|
+
3. **Install Crackerjack:**
|
68
|
+
```
|
69
|
+
pip install crackerjack
|
70
|
+
```
|
71
|
+
|
72
|
+
4. **Initialize a New Project:**
|
73
|
+
Navigate to your project's root directory and run:
|
74
|
+
```
|
75
|
+
python -m crackerjack
|
76
|
+
```
|
77
|
+
|
78
|
+
---
|
79
|
+
|
55
80
|
## The Crackerjack Philosophy
|
56
81
|
|
57
82
|
Crackerjack is built on the following core principles:
|
@@ -61,7 +86,7 @@ Crackerjack is built on the following core principles:
|
|
61
86
|
- **Consistency:** Code style, formatting, and project structure should be consistent across projects.
|
62
87
|
- **Reliability:** Tests are essential, and code should be checked rigorously.
|
63
88
|
- **Tool Integration:** Leverage powerful existing tools instead of reinventing the wheel.
|
64
|
-
-
|
89
|
+
- **Static Typing:** Static typing is essential for all development.
|
65
90
|
|
66
91
|
## Key Features
|
67
92
|
|
@@ -76,7 +101,7 @@ Crackerjack provides:
|
|
76
101
|
- **Built-in Testing:** Automatically runs tests using `pytest`.
|
77
102
|
- **Easy Version Bumping:** Provides commands to bump the project version (micro, minor, or major).
|
78
103
|
- **Simplified Publishing:** Automates publishing to PyPI via PDM.
|
79
|
-
-
|
104
|
+
- **Commit and Push:** Commits and pushes your changes.
|
80
105
|
|
81
106
|
## Pre-commit Hooks
|
82
107
|
|
@@ -101,7 +126,7 @@ Crackerjack projects adhere to these guidelines:
|
|
101
126
|
|
102
127
|
- **Static Typing:** Use type hints consistently throughout your code.
|
103
128
|
- **Explicit Naming:** Choose clear, descriptive names for classes, functions, variables, and other identifiers.
|
104
|
-
- **Markdown for Documentation:** Use Markdown (`.md`) for all documentation,
|
129
|
+
- **Markdown for Documentation:** Use Markdown (`.md`) for all documentation, READMEs, etc.
|
105
130
|
- **Pathlib:** Use `pathlib.Path` for handling file and directory paths instead of `os.path`.
|
106
131
|
- **Consistent Imports:** Use `import typing as t` for type hinting.
|
107
132
|
- **Constants and Config:** Do not use all-caps for constants or configuration settings.
|
@@ -141,12 +166,14 @@ Run Crackerjack from the root of your Python project using:
|
|
141
166
|
- `-i`, `--interactive`: Run pre-commit hooks interactively when possible.
|
142
167
|
- `-n`, `--no-config-updates`: Skip updating configuration files (e.g., `pyproject.toml`).
|
143
168
|
- `-u`, `--update-precommit`: Update pre-commit hooks to the latest versions.
|
144
|
-
- `-
|
169
|
+
- `-d`, `--doc`: Generate documentation. (not yet implemented)
|
170
|
+
- `-v`, `--verbose`: Enable verbose output. (not yet implemented)
|
145
171
|
- `-p`, `--publish <micro|minor|major>`: Bump the project version and publish to PyPI using PDM.
|
146
172
|
- `-b`, `--bump <micro|minor|major>`: Bump the project version without publishing.
|
147
173
|
- `-x`, `--clean`: Clean code by removing docstrings, line comments, and extra whitespace.
|
148
174
|
- `-t`, `--test`: Run tests using `pytest`.
|
149
|
-
- `-
|
175
|
+
- `-a`, `--all`: Run with `-x -t -p <micro|minor|major> -c` development options.
|
176
|
+
- `--help`: Display help.
|
150
177
|
|
151
178
|
### Example Workflows
|
152
179
|
|
@@ -156,7 +183,7 @@ Run Crackerjack from the root of your Python project using:
|
|
156
183
|
```
|
157
184
|
|
158
185
|
- **Clean code, run checks, run tests, then commit:**
|
159
|
-
|
186
|
+
```
|
160
187
|
python -m crackerjack -c -x -t
|
161
188
|
```
|
162
189
|
|
@@ -174,15 +201,27 @@ Run Crackerjack from the root of your Python project using:
|
|
174
201
|
```
|
175
202
|
python -m crackerjack -b major
|
176
203
|
```
|
204
|
+
|
177
205
|
- **Update pre-commit hooks:**
|
178
206
|
```
|
179
207
|
python -m crackerjack -u
|
180
208
|
```
|
209
|
+
|
181
210
|
- **Get help:**
|
182
211
|
```
|
183
|
-
python -m crackerjack
|
212
|
+
python -m crackerjack --help
|
184
213
|
```
|
185
214
|
|
215
|
+
- **Clean code, run checks, run tests, bump version, publish, then commit:**
|
216
|
+
```
|
217
|
+
python -m crackerjack -x -t -p minor -c
|
218
|
+
|
219
|
+
# or even easier
|
220
|
+
|
221
|
+
python -m crackerjack -a minor
|
222
|
+
```
|
223
|
+
|
224
|
+
|
186
225
|
## Contributing
|
187
226
|
|
188
227
|
Crackerjack is an evolving project. Contributions are welcome! Please open a pull request or issue.
|
@@ -1,7 +1,7 @@
|
|
1
|
-
crackerjack-0.
|
2
|
-
crackerjack-0.
|
3
|
-
crackerjack-0.
|
4
|
-
crackerjack-0.
|
1
|
+
crackerjack-0.13.0.dist-info/METADATA,sha256=tosPl42vttJ7H3wxdi5HBsCg83BTAIFRfMoxvh5U5jQ,11055
|
2
|
+
crackerjack-0.13.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
crackerjack-0.13.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
|
+
crackerjack-0.13.0.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
5
5
|
crackerjack/.coverage,sha256=dLzPzp72qZEXohNfxnOAlRwvM9dqF06-HoFqfvXZd1U,53248
|
6
6
|
crackerjack/.gitignore,sha256=l8ErBAypC3rI6N9lhc7ZMdOw87t0Tz69ZW5C6uj15Wg,214
|
7
7
|
crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
|
@@ -40,13 +40,13 @@ crackerjack/.ruff_cache/0.7.1/1024065805990144819,sha256=3Sww592NB0PWBNHU_UIqvqg
|
|
40
40
|
crackerjack/.ruff_cache/0.7.1/285614542852677309,sha256=mOHKRzKoSvW-1sHtqI_LHWRt-mBinJ4rQRtp9Yqzv5I,224
|
41
41
|
crackerjack/.ruff_cache/0.7.3/16061516852537040135,sha256=AWJR9gmaO7-wpv8mY1homuwI8CrMPI3VrnbXH-wRPlg,224
|
42
42
|
crackerjack/.ruff_cache/0.8.4/16354268377385700367,sha256=Ksz4X8N6Z1i83N0vV1PxmBRlqgjrtzmDCOg7VBF4baQ,224
|
43
|
-
crackerjack/.ruff_cache/0.9.10/12813592349865671909,sha256=
|
43
|
+
crackerjack/.ruff_cache/0.9.10/12813592349865671909,sha256=ljyRwrfGnholtUN-9x9096LMPL8qRpp8G_h_zDCZvnE,224
|
44
44
|
crackerjack/.ruff_cache/0.9.3/13948373885254993391,sha256=kGhtIkzPUtKAgvlKs3D8j4QM4qG8RhsHrmQJI69Sv3o,224
|
45
45
|
crackerjack/.ruff_cache/0.9.9/12813592349865671909,sha256=tmr8_vhRD2OxsVuMfbJPdT9fDFX-d5tfC5U9jgziyho,224
|
46
46
|
crackerjack/.ruff_cache/0.9.9/8843823720003377982,sha256=e4ymkXfQsUg5e_mtO34xTsaTvs1uA3_fI216Qq9qCAM,136
|
47
47
|
crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
|
48
|
-
crackerjack/__init__.py,sha256=
|
49
|
-
crackerjack/__main__.py,sha256=
|
50
|
-
crackerjack/crackerjack.py,sha256=
|
51
|
-
crackerjack/pyproject.toml,sha256=
|
52
|
-
crackerjack-0.
|
48
|
+
crackerjack/__init__.py,sha256=EOKnIXfBAvxS55uPkpk5DbcNqVS29wja_IcCPaGwyus,141
|
49
|
+
crackerjack/__main__.py,sha256=11gg9itMrUY7-7vPFGc1MrNOuOFIzdm0vheW_PMS_Gk,3783
|
50
|
+
crackerjack/crackerjack.py,sha256=RUj2OQ6gnTavj5dfQuAVd1-rWxmGiamR7gnVd8Cfkrs,18003
|
51
|
+
crackerjack/pyproject.toml,sha256=T55z6QM_uW0MYsh5y4ufm4NAKU5_6MADcbEw2i5GOYY,3442
|
52
|
+
crackerjack-0.13.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|