crackerjack 0.7.36__py3-none-any.whl → 0.8.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.
Potentially problematic release.
This version of crackerjack might be problematic. Click here for more details.
- crackerjack/.pre-commit-config.yaml +4 -10
- crackerjack/__main__.py +3 -4
- crackerjack/crackerjack.py +15 -11
- crackerjack/pyproject.toml +15 -12
- {crackerjack-0.7.36.dist-info → crackerjack-0.8.0.dist-info}/METADATA +3 -8
- {crackerjack-0.7.36.dist-info → crackerjack-0.8.0.dist-info}/RECORD +8 -8
- {crackerjack-0.7.36.dist-info → crackerjack-0.8.0.dist-info}/WHEEL +0 -0
- {crackerjack-0.7.36.dist-info → crackerjack-0.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -16,13 +16,10 @@ repos:
|
|
|
16
16
|
name: check-toml
|
|
17
17
|
- id: check-added-large-files
|
|
18
18
|
name: check-added-large-files
|
|
19
|
-
- repo: https://github.com/
|
|
20
|
-
rev: '24.4.2'
|
|
21
|
-
hooks:
|
|
22
|
-
- id: black
|
|
23
|
-
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
19
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
24
20
|
rev: v0.4.7
|
|
25
21
|
hooks:
|
|
22
|
+
- id: ruff-format
|
|
26
23
|
- id: ruff
|
|
27
24
|
- repo: https://github.com/fredrikaverpil/creosote
|
|
28
25
|
rev: v3.0.0
|
|
@@ -69,14 +66,11 @@ repos:
|
|
|
69
66
|
rev: v1.1.365
|
|
70
67
|
hooks:
|
|
71
68
|
- id: pyright
|
|
72
|
-
- repo: https://github.com/
|
|
69
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
73
70
|
rev: v0.4.7
|
|
74
71
|
hooks:
|
|
75
72
|
- id: ruff
|
|
76
|
-
|
|
77
|
-
rev: '24.4.2'
|
|
78
|
-
hooks:
|
|
79
|
-
- id: black
|
|
73
|
+
- id: ruff-format
|
|
80
74
|
# - repo: https://github.com/pdoc3/pdoc
|
|
81
75
|
# rev: master
|
|
82
76
|
# hooks:
|
crackerjack/__main__.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import typing as t
|
|
3
3
|
|
|
4
|
-
from click import command
|
|
5
|
-
from click import help_option
|
|
6
|
-
from click import option
|
|
7
|
-
from crackerjack import crackerjack_it
|
|
4
|
+
from click import command, help_option, option
|
|
8
5
|
from pydantic import BaseModel
|
|
9
6
|
|
|
7
|
+
from crackerjack import crackerjack_it
|
|
8
|
+
|
|
10
9
|
|
|
11
10
|
class Options(BaseModel):
|
|
12
11
|
commit: bool = False
|
crackerjack/crackerjack.py
CHANGED
|
@@ -5,10 +5,8 @@ import typing as t
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from subprocess import run
|
|
7
7
|
|
|
8
|
-
from acb.actions.encode import dump
|
|
9
|
-
from
|
|
10
|
-
from aioconsole import ainput
|
|
11
|
-
from aioconsole import aprint
|
|
8
|
+
from acb.actions.encode import dump, load
|
|
9
|
+
from aioconsole import ainput, aprint
|
|
12
10
|
from aiopath import AsyncPath
|
|
13
11
|
from inflection import underscore
|
|
14
12
|
from pydantic import BaseModel
|
|
@@ -121,7 +119,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
121
119
|
run([str(self.config.git_path), "config", "advice.addIgnoredFile", "false"])
|
|
122
120
|
await self.update_pyproject_configs()
|
|
123
121
|
|
|
124
|
-
async def
|
|
122
|
+
async def load_config(self) -> None:
|
|
125
123
|
await self.settings_path.touch(exist_ok=True)
|
|
126
124
|
try:
|
|
127
125
|
self.config = Config(**await load.yaml(self.settings_path))
|
|
@@ -129,6 +127,17 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
129
127
|
self.config = Config()
|
|
130
128
|
await dump.yaml(self.config.model_dump(), self.settings_path)
|
|
131
129
|
raise SystemExit("\nPlease configure '.crackerjack.yaml' and try again\n")
|
|
130
|
+
|
|
131
|
+
async def run_pre_commit(self) -> None:
|
|
132
|
+
check_all = run([str(self.config.pre_commit_path), "run", "--all-files"])
|
|
133
|
+
if check_all.returncode > 0:
|
|
134
|
+
check_all = run([str(self.config.pre_commit_path), "run", "--all-files"])
|
|
135
|
+
if check_all.returncode > 0:
|
|
136
|
+
await aprint("\n\nPre-commit failed. Please fix errors.\n")
|
|
137
|
+
raise SystemExit()
|
|
138
|
+
|
|
139
|
+
async def process(self, options: t.Any) -> None:
|
|
140
|
+
await self.load_config()
|
|
132
141
|
imp_dir = self.pkg_path / "__pypackages__" / self.config.python_version / "lib"
|
|
133
142
|
sys.path.append(str(imp_dir))
|
|
134
143
|
self.pkg_name = underscore(self.pkg_path.stem.lower())
|
|
@@ -143,12 +152,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
143
152
|
if options.interactive:
|
|
144
153
|
for hook in ("refurb", "bandit", "pyright"):
|
|
145
154
|
await self.run_interactive(hook)
|
|
146
|
-
|
|
147
|
-
if check_all.returncode > 0:
|
|
148
|
-
check_all = run([str(self.config.pre_commit_path), "run", "--all-files"])
|
|
149
|
-
if check_all.returncode > 0:
|
|
150
|
-
await aprint("\n\nPre-commit failed. Please fix errors.\n")
|
|
151
|
-
raise SystemExit()
|
|
155
|
+
await self.run_pre_commit()
|
|
152
156
|
for option in (options.publish, options.bump):
|
|
153
157
|
if option:
|
|
154
158
|
run([str(self.config.pdm_path), "bump", option])
|
crackerjack/pyproject.toml
CHANGED
|
@@ -19,25 +19,28 @@ fix = true
|
|
|
19
19
|
show-fixes = true
|
|
20
20
|
output-format = "full"
|
|
21
21
|
|
|
22
|
+
[tool.ruff.format]
|
|
23
|
+
docstring-code-format = true
|
|
24
|
+
|
|
22
25
|
[tool.ruff.lint]
|
|
23
26
|
ignore = [
|
|
24
27
|
"F821",
|
|
28
|
+
"D100",
|
|
29
|
+
"D101",
|
|
30
|
+
"D102",
|
|
31
|
+
"D103",
|
|
32
|
+
"D104",
|
|
33
|
+
"D107",
|
|
34
|
+
]
|
|
35
|
+
extend-select = [
|
|
36
|
+
"I",
|
|
37
|
+
"C901",
|
|
38
|
+
"D",
|
|
25
39
|
]
|
|
26
|
-
|
|
27
|
-
[tool.ruff.lint.isort]
|
|
28
|
-
force-single-line = true
|
|
29
|
-
|
|
30
|
-
[tool.ruff.lint.mccabe]
|
|
31
|
-
max-complexity = 10
|
|
32
40
|
|
|
33
41
|
[tool.ruff.lint.pydocstyle]
|
|
34
42
|
convention = "google"
|
|
35
43
|
|
|
36
|
-
[tool.black]
|
|
37
|
-
target-version = [
|
|
38
|
-
"py312",
|
|
39
|
-
]
|
|
40
|
-
|
|
41
44
|
[tool.creosote]
|
|
42
45
|
paths = [
|
|
43
46
|
"crackerjack",
|
|
@@ -84,7 +87,7 @@ pythonPlatform = "Darwin"
|
|
|
84
87
|
|
|
85
88
|
[project]
|
|
86
89
|
name = "Crackerjack"
|
|
87
|
-
version = "0.7.
|
|
90
|
+
version = "0.7.36"
|
|
88
91
|
description = "Crackerjack code style"
|
|
89
92
|
requires-python = ">=3.12"
|
|
90
93
|
readme = "README.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Crackerjack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Crackerjack code style
|
|
5
5
|
Keywords: black,ruff,mypy,creosote,refurb
|
|
6
6
|
Home-page: https://github.com/lesleslie/crackerjack
|
|
@@ -39,6 +39,7 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
# Crackerjack Python
|
|
40
40
|
|
|
41
41
|
[](https://docs.python.org/3/)
|
|
42
|
+
[](https://github.com/astral-sh/ruff)
|
|
42
43
|
[](https://github.com/ambv/black)
|
|
43
44
|
[](https://microsoft.github.io/pyright/)
|
|
44
45
|
[](https://pdm.fming.dev)
|
|
@@ -98,7 +99,6 @@ This package:
|
|
|
98
99
|
- runs the following pre-commit hooks (in order):
|
|
99
100
|
* [pdm-lock-check](https://github.com/pdm-project/pdm)
|
|
100
101
|
* various core [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks)
|
|
101
|
-
* [black](https://github.com/psf/black)
|
|
102
102
|
* [ruff](https://github.com/charliermarsh/ruff-pre-commit)
|
|
103
103
|
* [creosote](https://github.com/fredrikaverpil/creosote)
|
|
104
104
|
* [flynt](https://github.com/ikamensh/flynt/)
|
|
@@ -107,8 +107,7 @@ This package:
|
|
|
107
107
|
* [refurb](https://github.com/dosisod/refurb)
|
|
108
108
|
* [bandit](https://github.com/PyCQA/bandit)
|
|
109
109
|
* [pyright](https://github.com/RobertCraigie/pyright-python)
|
|
110
|
-
* ruff (again for sanity checking)
|
|
111
|
-
* black (again for sanity checking)
|
|
110
|
+
* [ruff](https://github.com/charliermarsh/ruff-pre-commit) (again for sanity checking)
|
|
112
111
|
|
|
113
112
|
- converts/creates documentation in Markdown (md) (work in progress)
|
|
114
113
|
|
|
@@ -126,8 +125,6 @@ This package:
|
|
|
126
125
|
|
|
127
126
|
- all docstrings, README's, and other documentation is to be done in Markdown (md)
|
|
128
127
|
|
|
129
|
-
- format with black
|
|
130
|
-
|
|
131
128
|
- use aiopath.AsyncPath or pathlib.Path not os.path
|
|
132
129
|
|
|
133
130
|
- import typing as t
|
|
@@ -137,8 +134,6 @@ This package:
|
|
|
137
134
|
|
|
138
135
|
- functions that deal with path operations should get passed AsyncPaths or Paths - not strings
|
|
139
136
|
|
|
140
|
-
- force single line imports (will support isort Vertical Hanging Indent when ruff does)
|
|
141
|
-
|
|
142
137
|
- use PDM and PEP-582(proposed) for dependency management and package building/publishing
|
|
143
138
|
|
|
144
139
|
- use pdoc and mkdocs for producing documentation
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
crackerjack-0.
|
|
2
|
-
crackerjack-0.
|
|
3
|
-
crackerjack-0.
|
|
1
|
+
crackerjack-0.8.0.dist-info/METADATA,sha256=g2oY_n8MHna9uWw6t1xKvpfvDhRA9pdjPCWVTa3VlXA,7760
|
|
2
|
+
crackerjack-0.8.0.dist-info/WHEEL,sha256=vnE8JVcI2Wz7GRKorsPArnBdnW2SWKWGow5gu5tHlRU,90
|
|
3
|
+
crackerjack-0.8.0.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
|
4
4
|
crackerjack/.gitignore,sha256=aJ2x3-AcCEcaW_quI-j8RtOUcTqGNoLJGMq8mZ3lTrA,197
|
|
5
5
|
crackerjack/.libcst.codemod.yaml,sha256=TLE_I07llPTYk_tm36z-hN15O3X27qztNdJ3Ev9ODMk,768
|
|
6
|
-
crackerjack/.pre-commit-config.yaml,sha256=
|
|
6
|
+
crackerjack/.pre-commit-config.yaml,sha256=GgKMGwkKt_OtYNE2UpQ-hXXHkJTO-viRKJY2gYdv4GE,2264
|
|
7
7
|
crackerjack/.ruff_cache/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
|
|
8
8
|
crackerjack/.ruff_cache/0.1.11/3256171999636029978,sha256=-RLDsRf5uj09SyFQVzjwQ1HkTxjIRxNLLE24SEJxD4g,248
|
|
9
9
|
crackerjack/.ruff_cache/0.1.14/602324811142551221,sha256=HIYvldb69IHdMzquAA8JpzU2RDT9shEB_dPvzyeFZ_g,248
|
|
@@ -20,7 +20,7 @@ crackerjack/.ruff_cache/0.3.4/676973378459347183,sha256=qQXG3ByXNuDvpqAhrhjcQVJY
|
|
|
20
20
|
crackerjack/.ruff_cache/0.3.5/16311176246009842383,sha256=1jdzqow8vaK7V6TGKnAFbiL-JUeOUjP8XgYifP1Tg5s,248
|
|
21
21
|
crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
|
|
22
22
|
crackerjack/__init__.py,sha256=AuglbbJHkUJ2GdvyT0ca35ntexo1RkT2V6DgypoFeEk,121
|
|
23
|
-
crackerjack/__main__.py,sha256=
|
|
24
|
-
crackerjack/crackerjack.py,sha256=
|
|
25
|
-
crackerjack/pyproject.toml,sha256=
|
|
26
|
-
crackerjack-0.
|
|
23
|
+
crackerjack/__main__.py,sha256=KF-AnEzQgY18ijVQsX11f8BgiWnfCEIqhn_URddKDec,1767
|
|
24
|
+
crackerjack/crackerjack.py,sha256=jYzZLsqUYZWaLhe9RG375Y6Ij5jDCWg_Km8gLsEX2Iw,7906
|
|
25
|
+
crackerjack/pyproject.toml,sha256=bvUskR5XPVGn6DXtsQyADFtpo7H2dwSdKF-Crn2TrpY,2776
|
|
26
|
+
crackerjack-0.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|