crackerjack 0.9.2__py3-none-any.whl → 0.10.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.
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pdm-project/pdm
3
- rev: 2.19.3 # a PDM release exposing the hook
3
+ rev: 2.20.0.post1 # a PDM release exposing the hook
4
4
  hooks:
5
5
  - id: pdm-lock-check
6
6
  - repo: https://github.com/pre-commit/pre-commit-hooks
@@ -17,7 +17,7 @@ repos:
17
17
  - id: check-added-large-files
18
18
  name: check-added-large-files
19
19
  - repo: https://github.com/astral-sh/ruff-pre-commit
20
- rev: v0.7.1
20
+ rev: v0.7.3
21
21
  hooks:
22
22
  - id: ruff-format
23
23
  - id: ruff
@@ -65,11 +65,11 @@ repos:
65
65
  - id: bandit
66
66
  args: ["-c", "pyproject.toml"]
67
67
  - repo: https://github.com/RobertCraigie/pyright-python
68
- rev: v1.1.386
68
+ rev: v1.1.388
69
69
  hooks:
70
70
  - id: pyright
71
71
  - repo: https://github.com/astral-sh/ruff-pre-commit
72
- rev: v0.7.1
72
+ rev: v0.7.3
73
73
  hooks:
74
74
  - id: ruff
75
75
  - id: ruff-format
@@ -13,11 +13,7 @@ from pydantic import BaseModel
13
13
 
14
14
 
15
15
  class Config(BaseModel):
16
- python_version: t.Optional[str] = None
17
- pre_commit_path: t.Optional[Path] = None
18
- git_path: t.Optional[Path] = None
19
- pdm_path: t.Optional[Path] = None
20
- zsh_path: t.Optional[Path] = None
16
+ python_version: str = "3.13"
21
17
 
22
18
 
23
19
  class Crackerjack(BaseModel, arbitrary_types_allowed=True):
@@ -90,14 +86,12 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
90
86
  "crackerjack", self.pkg_name
91
87
  )
92
88
  )
93
- execute([str(self.config.git_path), "add", config])
89
+ execute(["git", "add", config])
94
90
 
95
91
  async def run_interactive(self, hook: str) -> None:
96
92
  success: bool = False
97
93
  while not success:
98
- fail = execute(
99
- [str(self.config.pre_commit_path), "run", hook.lower(), "--all-files"]
100
- )
94
+ fail = execute(["pre-commit", "run", hook.lower(), "--all-files"])
101
95
  if fail.returncode > 0:
102
96
  retry = await ainput(f"\n\n{hook.title()} failed. Retry? (y/N): ")
103
97
  await aprint()
@@ -109,22 +103,20 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
109
103
  async def update_pkg_configs(self) -> None:
110
104
  await self.copy_configs()
111
105
  installed_pkgs = execute(
112
- [str(self.config.pdm_path), "list", "--freeze"],
106
+ ["pdm", "list", "--freeze"],
113
107
  capture_output=True,
114
108
  text=True,
115
109
  ).stdout.splitlines()
116
110
  if not len([pkg for pkg in installed_pkgs if "pre-commit" in pkg]):
117
- print('Installing "pre-commit"...')
118
- execute([str(self.config.pdm_path), "self", "add", "keyring"])
119
- execute([str(self.config.pdm_path), "config", "python.use_venv", "false"])
120
- execute([str(self.config.git_path), "init"])
121
- execute([str(self.config.git_path), "branch", "-m", "main"])
122
- execute([str(self.config.git_path), "add", "pyproject.toml"])
123
- execute([str(self.config.git_path), "add", "pdm.lock"])
124
- execute([str(self.config.pre_commit_path), "install"])
125
- execute(
126
- [str(self.config.git_path), "config", "advice.addIgnoredFile", "false"]
127
- )
111
+ print("Initializing project...")
112
+ execute(["pdm", "self", "add", "keyring"])
113
+ execute(["pdm", "config", "python.use_uv", "true"])
114
+ execute(["git", "init"])
115
+ execute(["git", "branch", "-m", "main"])
116
+ execute(["git", "add", "pyproject.toml"])
117
+ execute(["git", "add", "pdm.lock"])
118
+ execute(["pre-commit", "install"])
119
+ execute(["git", "config", "advice.addIgnoredFile", "false"])
128
120
  await self.update_pyproject_configs()
129
121
 
130
122
  async def load_config(self) -> None:
@@ -137,42 +129,38 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
137
129
  raise SystemExit("\nPlease configure '.crackerjack.yaml' and try again\n")
138
130
 
139
131
  async def run_pre_commit(self) -> None:
140
- check_all = execute([str(self.config.pre_commit_path), "run", "--all-files"])
132
+ check_all = execute(["pre-commit", "run", "--all-files"])
141
133
  if check_all.returncode > 0:
142
- check_all = execute(
143
- [str(self.config.pre_commit_path), "run", "--all-files"]
144
- )
134
+ check_all = execute(["pre-commit", "run", "--all-files"])
145
135
  if check_all.returncode > 0:
146
136
  await aprint("\n\nPre-commit failed. Please fix errors.\n")
147
137
  raise SystemExit()
148
138
 
149
139
  async def process(self, options: t.Any) -> None:
150
- imp_dir = self.pkg_path / "__pypackages__" / self.config.python_version / "lib"
151
- sys.path.append(str(imp_dir))
152
140
  self.pkg_name = underscore(self.pkg_path.stem.lower())
153
141
  self.pkg_dir = self.pkg_path / self.pkg_name
154
142
  await self.pkg_dir.mkdir(exist_ok=True)
155
143
  await aprint("\nCrackerjacking...\n")
156
144
  if not options.do_not_update_configs:
157
145
  await self.update_pkg_configs()
158
- execute([str(self.config.pdm_path), "install"])
146
+ execute(["pdm", "install"])
159
147
  if self.pkg_path.stem == "crackerjack" and options.update_precommit:
160
- execute([str(self.config.pre_commit_path), "autoupdate"])
148
+ execute(["pre-commit", "autoupdate"])
161
149
  if options.interactive:
162
150
  for hook in ("refurb", "bandit", "pyright"):
163
151
  await self.run_interactive(hook)
164
152
  await self.run_pre_commit()
165
153
  for option in (options.publish, options.bump):
166
154
  if option:
167
- execute([str(self.config.pdm_path), "bump", option])
155
+ execute(["pdm", "bump", option])
168
156
  break
169
157
  if options.publish:
170
- execute([str(self.config.pdm_path), "publish"])
158
+ execute(["pdm", "publish"])
171
159
  if options.commit:
172
160
  commit_msg = await ainput("\nCommit message: ")
173
161
  execute(
174
162
  [
175
- str(self.config.git_path),
163
+ "git",
176
164
  "commit",
177
165
  "-m",
178
166
  str(commit_msg),
@@ -181,16 +169,11 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
181
169
  ".",
182
170
  ]
183
171
  )
184
- execute([str(self.config.git_path), "push", "origin", "main"])
172
+ execute(["git", "push", "origin", "main"])
185
173
  await aprint("\nCrackerjack complete!\n")
186
174
 
187
175
  async def run(self, options: t.Any) -> None:
188
176
  await self.load_config()
189
- execute(
190
- 'eval "$(pdm --pep582)"',
191
- shell=True, # noqa
192
- executable=str(self.config.zsh_path),
193
- )
194
177
  process = asyncio.create_task(self.process(options))
195
178
  await process
196
179
 
@@ -88,7 +88,7 @@ exclude = [
88
88
  "scratch",
89
89
  ]
90
90
  extraPaths = [
91
- "__pypackages__/3.13/lib/",
91
+ ".venv/lib/python3.13/site-packages/",
92
92
  ]
93
93
  typeCheckingMode = "strict"
94
94
  reportMissingTypeStubs = false
@@ -101,11 +101,10 @@ reportPrivateUsage = "warning"
101
101
  pythonVersion = "3.13"
102
102
  pythonPlatform = "Darwin"
103
103
 
104
- [tool.pdm]
105
104
  [project]
106
- name = "Crackerjack"
107
- version = "0.9.1"
108
- description = "Crackerjack code style"
105
+ name = "crackerjack"
106
+ version = "0.9.2"
107
+ description = "Default template for PDM package"
109
108
  requires-python = ">=3.13"
110
109
  readme = "README.md"
111
110
  keywords = [
@@ -131,16 +130,16 @@ classifiers = [
131
130
  ]
132
131
  dependencies = [
133
132
  "click>=8.1.7",
134
- "aioconsole>=0.8.0",
133
+ "aioconsole>=0.8.1",
135
134
  "inflection>=0.5.1",
136
135
  "autotyping>=24.9.0",
137
136
  "pre-commit>=4.0.1",
138
137
  "pytest>=8.3.3",
139
138
  "pydantic>=2.9.2",
140
139
  "aiopath>=0.7.7",
141
- "acb>=0.8.0",
142
140
  "pdm-bump>=0.9.8",
143
- "pdm>=2.19.3",
141
+ "pdm>=2.20.1",
142
+ "acb>=0.8.6",
144
143
  ]
145
144
  authors = [
146
145
  { name = "lesleslie", email = "les@wedgwoodwebworks.com" },
@@ -150,15 +149,14 @@ maintainers = [
150
149
  ]
151
150
 
152
151
  [project.license]
153
- text = "BSD-3-Clause"
152
+ text = "BSD-3-CLAUSE"
154
153
 
155
154
  [project.urls]
156
155
  homepage = "https://github.com/lesleslie/crackerjack"
157
156
  documentation = "https://github.com/lesleslie/crackerjack"
158
157
  repository = "https://github.com/lesleslie/crackerjack"
159
158
 
159
+
160
160
  [build-system]
161
- requires = [
162
- "pdm-backend",
163
- ]
161
+ requires = ["pdm-backend"]
164
162
  build-backend = "pdm.backend"
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
- Name: Crackerjack
3
- Version: 0.9.2
4
- Summary: Crackerjack code style
2
+ Name: crackerjack
3
+ Version: 0.10.0
4
+ Summary: Default template for PDM package
5
5
  Keywords: black,ruff,mypy,creosote,refurb
6
6
  Author-Email: lesleslie <les@wedgwoodwebworks.com>
7
7
  Maintainer-Email: lesleslie <les@wedgwoodwebworks.com>
8
- License: BSD-3-Clause
8
+ License: BSD-3-CLAUSE
9
9
  Classifier: Environment :: Console
10
10
  Classifier: Operating System :: POSIX
11
11
  Classifier: Programming Language :: Python
@@ -23,25 +23,26 @@ Project-URL: documentation, https://github.com/lesleslie/crackerjack
23
23
  Project-URL: repository, https://github.com/lesleslie/crackerjack
24
24
  Requires-Python: >=3.13
25
25
  Requires-Dist: click>=8.1.7
26
- Requires-Dist: aioconsole>=0.8.0
26
+ Requires-Dist: aioconsole>=0.8.1
27
27
  Requires-Dist: inflection>=0.5.1
28
28
  Requires-Dist: autotyping>=24.9.0
29
29
  Requires-Dist: pre-commit>=4.0.1
30
30
  Requires-Dist: pytest>=8.3.3
31
31
  Requires-Dist: pydantic>=2.9.2
32
32
  Requires-Dist: aiopath>=0.7.7
33
- Requires-Dist: acb>=0.8.0
34
33
  Requires-Dist: pdm-bump>=0.9.8
35
- Requires-Dist: pdm>=2.19.3
34
+ Requires-Dist: pdm>=2.20.1
35
+ Requires-Dist: acb>=0.8.6
36
36
  Description-Content-Type: text/markdown
37
37
 
38
38
  # Crackerjack Python
39
39
 
40
- [![Python: 3.12](https://img.shields.io/badge/python-3.12%2B-blue)](https://docs.python.org/3/)
40
+ [![Python: 3.13](https://img.shields.io/badge/python-3.13%2B-blue)](https://docs.python.org/3/)
41
41
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
42
42
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
43
43
  [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
44
44
  [![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm.fming.dev)
45
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
45
46
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
46
47
  [![Code style: crackerjack](https://img.shields.io/badge/code%20style-crackerjack-000042)](https://github.com/lesleslie/crackerjack)
47
48
 
@@ -58,34 +59,6 @@ straight forward to read. Documentation and tests should be able to write themse
58
59
  Crackerjack provides a set of guidelines and utilities to keep the codebase clean, elegant, standardized, and
59
60
  easily readable.
60
61
 
61
- ### **Crackerjack philosophy...**
62
-
63
- #### Virtual envs:
64
-
65
- Let's face it virtual envs are a mess and a lot of time and resources are
66
- spent maintaining them. [This](https://miro.medium.com/v2/resize:fit:984/format:webp/1*mHrDuetdLskvNHYucD9u3g.png) pretty
67
- much says it all. Enough is enough.
68
-
69
- #### Regression testing:
70
-
71
- Again, here is what we believe become to be waste of time too. It takes more time to keep codebases compliant
72
- with previous versions of python than it does to just update your code to run the latest versions of python
73
- as they are released (within a liberal-ish timeline of course). Why are you running old versions of python anyway.
74
- There are various easy ways to keep your system python versions up-to-date and
75
- Docker containers for the latest versions are available immediately upon release. Most cloud providers
76
- will support the new versions in their virtual machines and containers shortly after release as well. If your dependencies
77
- break upon upgrade, file a bug report or fix it yourself. Simple enough.
78
-
79
- #### ...the Crackerjack solution:
80
-
81
- Crackerjack uses PDM with PEP-582 (yes, PEP-582 has been rejected but PDM still supports it and Crackerjack will continue to use it!).
82
- No more virtualenvs. Update your system python versions as they are released and start
83
- migrating your code. Crackerjack, and Crackerjack'd packages, should support the latest
84
- python release's features within 2 month after the release and depend solely on that version. Again, if
85
- something breaks, file a bug report or, even better, fix it yourself (maybe even learn something new things in the process).
86
- Easy-peasy. You just saved yourself a zillion headaches and can sleep
87
- better at night now.
88
-
89
62
  ### **What does this package do?**
90
63
 
91
64
  This package:
@@ -99,6 +72,7 @@ This package:
99
72
  * [pdm-lock-check](https://github.com/pdm-project/pdm)
100
73
  * various core [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks)
101
74
  * [ruff](https://github.com/charliermarsh/ruff-pre-commit)
75
+ * [vulture](https://github.com/jendrikseipp/vulture)
102
76
  * [creosote](https://github.com/fredrikaverpil/creosote)
103
77
  * [flynt](https://github.com/ikamensh/flynt/)
104
78
  * [codespell](https://github.com/codespell-project/codespell)
@@ -133,13 +107,13 @@ This package:
133
107
 
134
108
  - functions that deal with path operations should get passed AsyncPaths or Paths - not strings
135
109
 
136
- - use PDM and PEP-582(proposed) for dependency management and package building/publishing
110
+ - use PDM (uv support enabled) for dependency management and package building/publishing
137
111
 
138
112
  - use pdoc and mkdocs for producing documentation
139
113
 
140
114
  - use pytest for testing
141
115
 
142
- - be compliant with the latest python version within 2 months after release
116
+ - be compliant with, and only support, the latest python version within 2 months after release
143
117
 
144
118
 
145
119
 
@@ -175,7 +149,9 @@ When you ready to publish your project:
175
149
  The -p option not only publishes your project but will bump your
176
150
  project version for you. The options are 'micro', 'minor', and 'major'.
177
151
  Put the -c option at the end and commit the bumped version to your git
178
- repository at the same time.
152
+ repository at the same time:
153
+
154
+ ``python -m crackerjack -p micro -c``
179
155
 
180
156
  ### **Contributing**
181
157
 
@@ -1,10 +1,10 @@
1
- crackerjack-0.9.2.dist-info/METADATA,sha256=kVBabP-RulnS9GPefFAm3kztJKY5zK88WhZBXRtqQbQ,7699
2
- crackerjack-0.9.2.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- crackerjack-0.9.2.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- crackerjack-0.9.2.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
1
+ crackerjack-0.10.0.dist-info/METADATA,sha256=u0dnTCxUbMeK2XRrOfDGmC8wbfEG73DuBifLAyEG3pg,6281
2
+ crackerjack-0.10.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ crackerjack-0.10.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ crackerjack-0.10.0.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
5
5
  crackerjack/.gitignore,sha256=7qePRaD8q-U6oV3gvgAcwFF8GudcRGAWf-Z-0IDqMaE,207
6
6
  crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
7
- crackerjack/.pre-commit-config.yaml,sha256=xqxFHeO5qlN6-w5I3s4gWM5AuivZlR-xc6vBa_p-e7I,2266
7
+ crackerjack/.pre-commit-config.yaml,sha256=svInZjMmLFGB7hRBvsljiF0rfWZzD7kO4ml26TavY0E,2272
8
8
  crackerjack/.ruff_cache/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
9
9
  crackerjack/.ruff_cache/0.1.11/3256171999636029978,sha256=-RLDsRf5uj09SyFQVzjwQ1HkTxjIRxNLLE24SEJxD4g,248
10
10
  crackerjack/.ruff_cache/0.1.14/602324811142551221,sha256=HIYvldb69IHdMzquAA8JpzU2RDT9shEB_dPvzyeFZ_g,248
@@ -29,11 +29,12 @@ crackerjack/.ruff_cache/0.6.4/1206147804896221174,sha256=R7O7kFH1eaafsVBj8Tae7By
29
29
  crackerjack/.ruff_cache/0.6.5/1206147804896221174,sha256=nnb6nWwDVgf1ka9tDmRNyrVOa5D0jWjXGo2SdIOrwE4,224
30
30
  crackerjack/.ruff_cache/0.6.7/3657366982708166874,sha256=MKU1_a_3BRoP6rKfsIyYJy3lzoXrYcsSw4y8y8ztLb8,224
31
31
  crackerjack/.ruff_cache/0.6.9/285614542852677309,sha256=6FVRfczYzXuiY_uArIpjA5Tue579y7kFL7hgvebRU2I,224
32
- crackerjack/.ruff_cache/0.7.1/1024065805990144819,sha256=LAmLzPcC0fqtPlhkTxPgyvDRNnqwV23iUUo9UMapsFA,224
32
+ crackerjack/.ruff_cache/0.7.1/1024065805990144819,sha256=3Sww592NB0PWBNHU_UIqvqgx33GEckEqKoFXxiu2wkA,224
33
33
  crackerjack/.ruff_cache/0.7.1/285614542852677309,sha256=mOHKRzKoSvW-1sHtqI_LHWRt-mBinJ4rQRtp9Yqzv5I,224
34
+ crackerjack/.ruff_cache/0.7.3/16061516852537040135,sha256=t-UdI4sjIl3hwoVdDRJqnIQGg-2jJcsagXlXjiZClVg,224
34
35
  crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
35
36
  crackerjack/__init__.py,sha256=AuglbbJHkUJ2GdvyT0ca35ntexo1RkT2V6DgypoFeEk,121
36
37
  crackerjack/__main__.py,sha256=W0KSo35_rmj_p4Zr2Q6FAvojiiPTmh5kjlggVNcOdac,1766
37
- crackerjack/crackerjack.py,sha256=aoknG7btKND58d0Gb1Hde02NME7J64r7wvwV2TmxZDo,8440
38
- crackerjack/pyproject.toml,sha256=FC7qsV5Op1b0DYo7GrFlB_d42mAgeZikiUBJhfeR00c,3005
39
- crackerjack-0.9.2.dist-info/RECORD,,
38
+ crackerjack/crackerjack.py,sha256=keEsTtVJ5G1VzX-RVg2GsyogGTu6bGZvNYsRdwDXGD4,7522
39
+ crackerjack/pyproject.toml,sha256=LA73l6K15LCBIs4SF85kTIJTcQsZk8eLyfLWdH_qwCM,3009
40
+ crackerjack-0.10.0.dist-info/RECORD,,