crackerjack 0.9.2__py3-none-any.whl → 0.10.2__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):
@@ -41,7 +37,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
41
37
  return
42
38
  our_toml_config: t.Any = await load.toml(self.our_toml_path) # type: ignore
43
39
  pkg_toml_config: t.Any = await load.toml(self.pkg_toml_path) # type: ignore
44
- pkg_deps = pkg_toml_config["tool"]["pdm"]["dev-dependencies"]
40
+ pkg_deps = pkg_toml_config["dependency-groups"]
45
41
  for tool, settings in our_toml_config["tool"].items():
46
42
  for setting, value in settings.items():
47
43
  if isinstance(value, str | list) and "crackerjack" in value:
@@ -62,7 +58,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
62
58
  our_toml_config["tool"][tool][setting] + value
63
59
  )
64
60
  pkg_toml_config["tool"][tool] = settings
65
- pkg_toml_config["tool"]["pdm"]["dev-dependencies"] = pkg_deps
61
+ pkg_toml_config["dependency-groups"] = pkg_deps
66
62
  python_version_pattern = r"\s*W*(\d\.\d*)"
67
63
  requires_python = our_toml_config["project"]["requires-python"]
68
64
  classifiers = []
@@ -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,44 @@ 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
+ build = execute(["pdm", "build"], capture_output=True, text=True)
159
+ await aprint(build.stdout)
160
+ if build.returncode > 0:
161
+ await aprint(build.stderr)
162
+ await aprint("\n\nBuild failed. Please fix errors.\n")
163
+ raise SystemExit()
164
+ execute(["pdm", "publish", "--no-build"])
171
165
  if options.commit:
172
166
  commit_msg = await ainput("\nCommit message: ")
173
167
  execute(
174
168
  [
175
- str(self.config.git_path),
169
+ "git",
176
170
  "commit",
177
171
  "-m",
178
172
  str(commit_msg),
@@ -181,16 +175,11 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
181
175
  ".",
182
176
  ]
183
177
  )
184
- execute([str(self.config.git_path), "push", "origin", "main"])
178
+ execute(["git", "push", "origin", "main"])
185
179
  await aprint("\nCrackerjack complete!\n")
186
180
 
187
181
  async def run(self, options: t.Any) -> None:
188
182
  await self.load_config()
189
- execute(
190
- 'eval "$(pdm --pep582)"',
191
- shell=True, # noqa
192
- executable=str(self.config.zsh_path),
193
- )
194
183
  process = asyncio.create_task(self.process(options))
195
184
  await process
196
185
 
@@ -60,6 +60,7 @@ exclude-deps = [
60
60
  "pdm",
61
61
  "pyfiglet",
62
62
  "pyyaml",
63
+ "uv",
63
64
  ]
64
65
 
65
66
  [tool.refurb]
@@ -88,7 +89,7 @@ exclude = [
88
89
  "scratch",
89
90
  ]
90
91
  extraPaths = [
91
- "__pypackages__/3.13/lib/",
92
+ ".venv/lib/python3.13/site-packages/",
92
93
  ]
93
94
  typeCheckingMode = "strict"
94
95
  reportMissingTypeStubs = false
@@ -101,11 +102,10 @@ reportPrivateUsage = "warning"
101
102
  pythonVersion = "3.13"
102
103
  pythonPlatform = "Darwin"
103
104
 
104
- [tool.pdm]
105
105
  [project]
106
- name = "Crackerjack"
107
- version = "0.9.1"
108
- description = "Crackerjack code style"
106
+ name = "crackerjack"
107
+ version = "0.10.1"
108
+ description = "Default template for PDM package"
109
109
  requires-python = ">=3.13"
110
110
  readme = "README.md"
111
111
  keywords = [
@@ -131,16 +131,17 @@ classifiers = [
131
131
  ]
132
132
  dependencies = [
133
133
  "click>=8.1.7",
134
- "aioconsole>=0.8.0",
134
+ "aioconsole>=0.8.1",
135
135
  "inflection>=0.5.1",
136
136
  "autotyping>=24.9.0",
137
137
  "pre-commit>=4.0.1",
138
138
  "pytest>=8.3.3",
139
139
  "pydantic>=2.9.2",
140
140
  "aiopath>=0.7.7",
141
- "acb>=0.8.0",
142
141
  "pdm-bump>=0.9.8",
143
- "pdm>=2.19.3",
142
+ "pdm>=2.20.1",
143
+ "acb>=0.8.6",
144
+ "uv>=0.5.1",
144
145
  ]
145
146
  authors = [
146
147
  { name = "lesleslie", email = "les@wedgwoodwebworks.com" },
@@ -150,15 +151,14 @@ maintainers = [
150
151
  ]
151
152
 
152
153
  [project.license]
153
- text = "BSD-3-Clause"
154
+ text = "BSD-3-CLAUSE"
154
155
 
155
156
  [project.urls]
156
157
  homepage = "https://github.com/lesleslie/crackerjack"
157
158
  documentation = "https://github.com/lesleslie/crackerjack"
158
159
  repository = "https://github.com/lesleslie/crackerjack"
159
160
 
161
+
160
162
  [build-system]
161
- requires = [
162
- "pdm-backend",
163
- ]
163
+ requires = ["pdm-backend"]
164
164
  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.2
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,27 @@ 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
+ Requires-Dist: uv>=0.5.1
36
37
  Description-Content-Type: text/markdown
37
38
 
38
39
  # Crackerjack Python
39
40
 
40
- [![Python: 3.12](https://img.shields.io/badge/python-3.12%2B-blue)](https://docs.python.org/3/)
41
+ [![Python: 3.13](https://img.shields.io/badge/python-3.13%2B-blue)](https://docs.python.org/3/)
41
42
  [![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
43
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
43
44
  [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
44
45
  [![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm.fming.dev)
46
+ [![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
47
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
46
48
  [![Code style: crackerjack](https://img.shields.io/badge/code%20style-crackerjack-000042)](https://github.com/lesleslie/crackerjack)
47
49
 
@@ -58,34 +60,6 @@ straight forward to read. Documentation and tests should be able to write themse
58
60
  Crackerjack provides a set of guidelines and utilities to keep the codebase clean, elegant, standardized, and
59
61
  easily readable.
60
62
 
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
63
  ### **What does this package do?**
90
64
 
91
65
  This package:
@@ -99,6 +73,7 @@ This package:
99
73
  * [pdm-lock-check](https://github.com/pdm-project/pdm)
100
74
  * various core [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks)
101
75
  * [ruff](https://github.com/charliermarsh/ruff-pre-commit)
76
+ * [vulture](https://github.com/jendrikseipp/vulture)
102
77
  * [creosote](https://github.com/fredrikaverpil/creosote)
103
78
  * [flynt](https://github.com/ikamensh/flynt/)
104
79
  * [codespell](https://github.com/codespell-project/codespell)
@@ -133,13 +108,13 @@ This package:
133
108
 
134
109
  - functions that deal with path operations should get passed AsyncPaths or Paths - not strings
135
110
 
136
- - use PDM and PEP-582(proposed) for dependency management and package building/publishing
111
+ - use PDM (uv support enabled) for dependency management and package building/publishing
137
112
 
138
113
  - use pdoc and mkdocs for producing documentation
139
114
 
140
115
  - use pytest for testing
141
116
 
142
- - be compliant with the latest python version within 2 months after release
117
+ - be compliant with, and only support, the latest python version within 2 months after release
143
118
 
144
119
 
145
120
 
@@ -175,7 +150,9 @@ When you ready to publish your project:
175
150
  The -p option not only publishes your project but will bump your
176
151
  project version for you. The options are 'micro', 'minor', and 'major'.
177
152
  Put the -c option at the end and commit the bumped version to your git
178
- repository at the same time.
153
+ repository at the same time:
154
+
155
+ ``python -m crackerjack -p micro -c``
179
156
 
180
157
  ### **Contributing**
181
158
 
@@ -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.2.dist-info/METADATA,sha256=XLFLRn6zaaNGLRKTCy_D-vzCLwFJ3nE8RfCyxIMtABA,6306
2
+ crackerjack-0.10.2.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ crackerjack-0.10.2.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ crackerjack-0.10.2.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=StGGw8v7KMh25_105fcUVjsYwJKt2E-s0Z1Ap-Zggac,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=ocObPBPogRtpcqUflluPOsUsSK4ymQa3iQrKAqLCme4,7811
39
+ crackerjack/pyproject.toml,sha256=0j7JN4BMu6uRK0qwQ6ZN2qoFfBcsji32YNxk1TNrYR8,3037
40
+ crackerjack-0.10.2.dist-info/RECORD,,