afterpython 0.4.3__tar.gz → 0.4.5__tar.gz
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.
- {afterpython-0.4.3 → afterpython-0.4.5}/PKG-INFO +1 -1
- {afterpython-0.4.3 → afterpython-0.4.5}/pyproject.toml +1 -1
- {afterpython-0.4.3 → afterpython-0.4.5}/pyproject.toml.orig +1 -1
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/init.py +33 -21
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pre-commit-config-template.yaml +0 -1
- {afterpython-0.4.3 → afterpython-0.4.5}/README.md +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/__init__.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/_io/toml.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/_io/yaml.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/_paths.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/_typing.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/__init__.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/build_pdoc.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/comments_json.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/content_json.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/faq_json.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/index_md.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/jupyter_notebook.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/llms_txt.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/marimo_content.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/marimo_notebook.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/markdown.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/metadata.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/builders/url_md.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/__init__.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/add.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/build.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/bump.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/changelog.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/check.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/clean.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/commit_msg.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/dev.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/format.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/init_branch_rules.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/install.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/lint.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/lock.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/prek.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/preview.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/release.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/remove.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/serve.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/start.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/sync.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/commands/update.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/cli/main.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/const.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/main.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/pcu.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/py.typed +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/afterpython-template.toml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/ci-workflow-template.yml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/cliff-template.toml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/dependabot-template.yml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/deploy-workflow-template.yml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pdoc/custom.css +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pdoc/frame.html.jinja2 +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pdoc/syntax-highlighting.css +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pdoc/theme.css +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/release-workflow-template.yml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/ruff-template.toml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/ty-template.toml +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/_afterpython.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/_git.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/branch_rules.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/github_actions.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/myst.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/prek.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/tools/pyproject.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/utils.py +0 -0
- {afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: afterpython
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Summary: CLI tool to streamline Python package maintenance and generate a dedicated project website
|
|
5
5
|
Keywords: package-maintenance,project-website,static-site-generator,developer-tools,documentation,cli-tool,ci/cd,mystmd,semantic-release,python-packaging
|
|
6
6
|
Author: Stephen Yau
|
|
@@ -25,13 +25,14 @@ def _find_ruff_config_conflicts() -> list[str]:
|
|
|
25
25
|
return conflicts
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def init_ruff():
|
|
28
|
+
def init_ruff() -> str | None:
|
|
29
|
+
"""Returns a skip notice when an existing config made it skip the setup, else None."""
|
|
29
30
|
import tomlkit
|
|
30
31
|
|
|
31
32
|
from afterpython.tools.pyproject import read_pyproject, write_pyproject
|
|
32
33
|
|
|
33
34
|
if conflicts := _find_ruff_config_conflicts():
|
|
34
|
-
|
|
35
|
+
return (
|
|
35
36
|
click.style(
|
|
36
37
|
f"Skipped ruff setup: found existing ruff config ({', '.join(conflicts)}).\n",
|
|
37
38
|
fg="yellow",
|
|
@@ -45,7 +46,6 @@ def init_ruff():
|
|
|
45
46
|
"To fix: remove the config(s) above (keep a copy of any settings you want), "
|
|
46
47
|
"run `ap init ruff`, then add your settings to afterpython/ruff.toml."
|
|
47
48
|
)
|
|
48
|
-
return
|
|
49
49
|
|
|
50
50
|
ruff_toml_path = ap.paths.afterpython_path / "ruff.toml"
|
|
51
51
|
if ruff_toml_path.exists():
|
|
@@ -57,7 +57,7 @@ def init_ruff():
|
|
|
57
57
|
|
|
58
58
|
data = read_pyproject()
|
|
59
59
|
if "ruff" in data.get("tool", {}):
|
|
60
|
-
return # already points to afterpython/ruff.toml (checked above)
|
|
60
|
+
return None # already points to afterpython/ruff.toml (checked above)
|
|
61
61
|
if "tool" not in data:
|
|
62
62
|
data["tool"] = tomlkit.table(is_super_table=True)
|
|
63
63
|
ruff_table = tomlkit.table()
|
|
@@ -65,6 +65,7 @@ def init_ruff():
|
|
|
65
65
|
data["tool"]["ruff"] = ruff_table
|
|
66
66
|
write_pyproject(data)
|
|
67
67
|
click.echo(f'Added [tool.ruff] extend = "{RUFF_EXTEND}" to pyproject.toml')
|
|
68
|
+
return None
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
def _find_ty_config_conflicts() -> list[str]:
|
|
@@ -80,9 +81,10 @@ def _find_ty_config_conflicts() -> list[str]:
|
|
|
80
81
|
return conflicts
|
|
81
82
|
|
|
82
83
|
|
|
83
|
-
def init_ty():
|
|
84
|
+
def init_ty() -> str | None:
|
|
85
|
+
"""Returns a skip notice when an existing config made it skip the setup, else None."""
|
|
84
86
|
if conflicts := _find_ty_config_conflicts():
|
|
85
|
-
|
|
87
|
+
return (
|
|
86
88
|
click.style(
|
|
87
89
|
f"Skipped ty setup: found existing ty config ({', '.join(conflicts)}).\n",
|
|
88
90
|
fg="yellow",
|
|
@@ -96,14 +98,14 @@ def init_ty():
|
|
|
96
98
|
"To fix: remove the config(s) above (keep a copy of any settings you want), "
|
|
97
99
|
"run `ap init ty`, then add your settings to afterpython/ty.toml."
|
|
98
100
|
)
|
|
99
|
-
return
|
|
100
101
|
|
|
101
102
|
ty_toml_path = ap.paths.afterpython_path / "ty.toml"
|
|
102
103
|
if ty_toml_path.exists():
|
|
103
104
|
click.echo(f"ty configuration file {ty_toml_path} already exists")
|
|
104
|
-
return
|
|
105
|
+
return None
|
|
105
106
|
shutil.copy(ap.paths.templates_path / "ty-template.toml", ty_toml_path)
|
|
106
107
|
click.echo(f"Created {ty_toml_path}")
|
|
108
|
+
return None
|
|
107
109
|
|
|
108
110
|
|
|
109
111
|
def _find_cliff_config_conflicts() -> list[str]:
|
|
@@ -119,9 +121,10 @@ def _find_cliff_config_conflicts() -> list[str]:
|
|
|
119
121
|
return conflicts
|
|
120
122
|
|
|
121
123
|
|
|
122
|
-
def init_cliff():
|
|
124
|
+
def init_cliff() -> str | None:
|
|
125
|
+
"""Returns a skip notice when an existing config made it skip the setup, else None."""
|
|
123
126
|
if conflicts := _find_cliff_config_conflicts():
|
|
124
|
-
|
|
127
|
+
return (
|
|
125
128
|
click.style(
|
|
126
129
|
f"Skipped git-cliff setup: found existing git-cliff config ({', '.join(conflicts)}).\n",
|
|
127
130
|
fg="yellow",
|
|
@@ -132,14 +135,14 @@ def init_cliff():
|
|
|
132
135
|
"To fix: remove the config(s) above (keep a copy of any settings you want), "
|
|
133
136
|
"run `ap init cliff`, then add your settings to afterpython/cliff.toml."
|
|
134
137
|
)
|
|
135
|
-
return
|
|
136
138
|
|
|
137
139
|
cliff_toml_path = ap.paths.afterpython_path / "cliff.toml"
|
|
138
140
|
if cliff_toml_path.exists():
|
|
139
141
|
click.echo(f"git-cliff configuration file {cliff_toml_path} already exists")
|
|
140
|
-
return
|
|
142
|
+
return None
|
|
141
143
|
shutil.copy(ap.paths.templates_path / "cliff-template.toml", cliff_toml_path)
|
|
142
144
|
click.echo(f"Created {cliff_toml_path}")
|
|
145
|
+
return None
|
|
143
146
|
|
|
144
147
|
|
|
145
148
|
def init_faq():
|
|
@@ -265,6 +268,8 @@ def init(ctx, yes, skip_website: bool):
|
|
|
265
268
|
_preflight_init(website="website" in steps)
|
|
266
269
|
|
|
267
270
|
click.echo("Initializing afterpython...")
|
|
271
|
+
# printed after everything else, so they're in the last lines of the (long) output
|
|
272
|
+
skip_notices: list[str] = []
|
|
268
273
|
try:
|
|
269
274
|
afterpython_path.mkdir(parents=True, exist_ok=True)
|
|
270
275
|
static_path.mkdir(parents=True, exist_ok=True)
|
|
@@ -284,15 +289,15 @@ def init(ctx, yes, skip_website: bool):
|
|
|
284
289
|
|
|
285
290
|
if "prek" in steps:
|
|
286
291
|
init_prek()
|
|
287
|
-
if "ruff" in steps:
|
|
288
|
-
|
|
289
|
-
if "ty" in steps:
|
|
290
|
-
|
|
292
|
+
if "ruff" in steps and (notice := init_ruff()):
|
|
293
|
+
skip_notices.append(notice)
|
|
294
|
+
if "ty" in steps and (notice := init_ty()):
|
|
295
|
+
skip_notices.append(notice)
|
|
291
296
|
# whatever was selected: keep ruff/ty hooks only for the tools that were set up
|
|
292
297
|
sync_hooks()
|
|
293
298
|
|
|
294
|
-
if "cliff" in steps:
|
|
295
|
-
|
|
299
|
+
if "cliff" in steps and (notice := init_cliff()):
|
|
300
|
+
skip_notices.append(notice)
|
|
296
301
|
if "release" in steps:
|
|
297
302
|
create_workflow("release")
|
|
298
303
|
if "dependabot" in steps:
|
|
@@ -303,6 +308,10 @@ def init(ctx, yes, skip_website: bool):
|
|
|
303
308
|
shutil.rmtree(afterpython_path, ignore_errors=True)
|
|
304
309
|
raise
|
|
305
310
|
|
|
311
|
+
for notice in skip_notices:
|
|
312
|
+
click.echo()
|
|
313
|
+
click.echo(notice)
|
|
314
|
+
|
|
306
315
|
|
|
307
316
|
@init.command("ruff")
|
|
308
317
|
def init_ruff_subcommand():
|
|
@@ -313,7 +322,8 @@ def init_ruff_subcommand():
|
|
|
313
322
|
"""
|
|
314
323
|
from afterpython.tools.prek import sync_hooks
|
|
315
324
|
|
|
316
|
-
init_ruff()
|
|
325
|
+
if notice := init_ruff():
|
|
326
|
+
click.echo(notice)
|
|
317
327
|
sync_hooks()
|
|
318
328
|
|
|
319
329
|
|
|
@@ -326,7 +336,8 @@ def init_ty_subcommand():
|
|
|
326
336
|
"""
|
|
327
337
|
from afterpython.tools.prek import sync_hooks
|
|
328
338
|
|
|
329
|
-
init_ty()
|
|
339
|
+
if notice := init_ty():
|
|
340
|
+
click.echo(notice)
|
|
330
341
|
sync_hooks()
|
|
331
342
|
|
|
332
343
|
|
|
@@ -337,7 +348,8 @@ def init_cliff_subcommand():
|
|
|
337
348
|
Use this to re-run the git-cliff setup, e.g. after removing a conflicting
|
|
338
349
|
git-cliff config that made `ap init` skip it.
|
|
339
350
|
"""
|
|
340
|
-
init_cliff()
|
|
351
|
+
if notice := init_cliff():
|
|
352
|
+
click.echo(notice)
|
|
341
353
|
|
|
342
354
|
|
|
343
355
|
@init.command("website")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/deploy-workflow-template.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/pdoc/syntax-highlighting.css
RENAMED
|
File without changes
|
|
File without changes
|
{afterpython-0.4.3 → afterpython-0.4.5}/src/afterpython/templates/release-workflow-template.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|