afterpython 0.3.8__tar.gz → 0.3.10__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.
Files changed (64) hide show
  1. {afterpython-0.3.8 → afterpython-0.3.10}/PKG-INFO +1 -1
  2. {afterpython-0.3.8 → afterpython-0.3.10}/pyproject.toml +1 -1
  3. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/index_md.py +27 -30
  4. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/deploy-workflow-template.yml +5 -0
  5. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/myst.py +4 -7
  6. {afterpython-0.3.8 → afterpython-0.3.10}/README.md +0 -0
  7. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/__init__.py +0 -0
  8. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/_io/toml.py +0 -0
  9. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/_io/yaml.py +0 -0
  10. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/_paths.py +0 -0
  11. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/_typing.py +0 -0
  12. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/__init__.py +0 -0
  13. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/build_pdoc.py +0 -0
  14. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/content_json.py +0 -0
  15. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/faq_json.py +0 -0
  16. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/jupyter_notebook.py +0 -0
  17. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/llms_txt.py +0 -0
  18. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/marimo_notebook.py +0 -0
  19. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/markdown.py +0 -0
  20. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/metadata.py +0 -0
  21. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/builders/url_md.py +0 -0
  22. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/__init__.py +0 -0
  23. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/add.py +0 -0
  24. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/build.py +0 -0
  25. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/bump.py +0 -0
  26. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/check.py +0 -0
  27. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/clean.py +0 -0
  28. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/commit.py +0 -0
  29. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/commitizen.py +0 -0
  30. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/dev.py +0 -0
  31. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/format.py +0 -0
  32. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/init.py +0 -0
  33. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/init_branch_rules.py +0 -0
  34. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/install.py +0 -0
  35. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/lock.py +0 -0
  36. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/pre_commit.py +0 -0
  37. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/preview.py +0 -0
  38. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/release.py +0 -0
  39. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/remove.py +0 -0
  40. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/serve.py +0 -0
  41. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/start.py +0 -0
  42. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/sync.py +0 -0
  43. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/commands/update.py +0 -0
  44. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/cli/main.py +0 -0
  45. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/const.py +0 -0
  46. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/main.py +0 -0
  47. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/pcu.py +0 -0
  48. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/py.typed +0 -0
  49. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/ci-workflow-template.yml +0 -0
  50. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/cz-template.toml +0 -0
  51. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/dependabot-template.yml +0 -0
  52. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/pdoc/frame.html.jinja2 +0 -0
  53. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/pre-commit-config-template.yaml +0 -0
  54. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/release-workflow-template.yml +0 -0
  55. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/templates/ruff-template.toml +0 -0
  56. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/_afterpython.py +0 -0
  57. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/_git.py +0 -0
  58. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/branch_rules.py +0 -0
  59. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/commitizen.py +0 -0
  60. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/github_actions.py +0 -0
  61. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/pre_commit.py +0 -0
  62. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/tools/pyproject.py +0 -0
  63. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/utils.py +0 -0
  64. {afterpython-0.3.8 → afterpython-0.3.10}/src/afterpython/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: afterpython
3
- Version: 0.3.8
3
+ Version: 0.3.10
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "afterpython"
3
- version = "0.3.8"
3
+ version = "0.3.10"
4
4
  description = "CLI tool to streamline Python package maintenance and generate a dedicated project website"
5
5
  license = "Apache-2.0"
6
6
  authors = [
@@ -4,17 +4,12 @@ import afterpython as ap
4
4
  from afterpython.const import CONTENT_TYPES, PLACEHOLDER_INDEX_MARKER
5
5
 
6
6
 
7
- def _legacy_placeholder_content(content_type: str) -> str:
8
- return f"""---
9
- title: ← {content_type.capitalize()}
10
- ---
11
-
12
- This is a placeholder index page. The actual {content_type} landing page is rendered by SvelteKit.
13
- """
14
-
15
-
16
- def _legacy_welcome_content(content_type: str) -> str:
17
- return f"""# Welcome to AfterPython
7
+ def _placeholder_content(content_type: str) -> str:
8
+ """Current placeholder body. Marker is an HTML comment so it embeds invisibly;
9
+ _is_afterpython_placeholder_index keys off it to tell our files apart from
10
+ user-authored ones."""
11
+ return f"""{PLACEHOLDER_INDEX_MARKER}
12
+ # Welcome to AfterPython
18
13
 
19
14
  Welcome to your project's {content_type}! This is a starter page to help you get started.
20
15
 
@@ -35,6 +30,19 @@ Start building your amazing project! 🚀
35
30
  """
36
31
 
37
32
 
33
+ def _legacy_placeholder_content(content_type: str) -> str:
34
+ """Frozen fingerprint of the arrow-stub placeholder written between commits
35
+ 49f30c1 and 3a560e2 (no marker). Kept solely so projects built in that window
36
+ are still recognized as ours and cleaned up rather than blocking with the
37
+ 'reserved' error. Do not edit — that would break recognition."""
38
+ return f"""---
39
+ title: ← {content_type.capitalize()}
40
+ ---
41
+
42
+ This is a placeholder index page. The actual {content_type} landing page is rendered by SvelteKit.
43
+ """
44
+
45
+
38
46
  def _is_afterpython_placeholder_index(index_md, content_type: str) -> bool:
39
47
  """Return True only for non-doc index.md files generated by AfterPython."""
40
48
  content = index_md.read_text(encoding="utf-8", errors="ignore")
@@ -43,7 +51,6 @@ def _is_afterpython_placeholder_index(index_md, content_type: str) -> bool:
43
51
  return (
44
52
  PLACEHOLDER_INDEX_MARKER in content
45
53
  or normalized_content == _legacy_placeholder_content(content_type).strip()
46
- or normalized_content == _legacy_welcome_content(content_type).strip()
47
54
  )
48
55
 
49
56
 
@@ -76,25 +83,15 @@ def create_placeholder_index_md_files():
76
83
  )
77
84
  continue
78
85
 
79
- content_path = ap.paths.afterpython_path / content_type
80
- myst_yml_path = content_path / "myst.yml"
81
-
82
- # Prepend index.md to TOC in myst.yml
83
- if myst_yml_path.exists():
84
- # Create placeholder index.md file
85
- _write_index_file(content_type)
86
- myst_data = read_yaml(myst_yml_path) or {}
87
- toc = myst_data.get("project", {}).get("toc", [])
86
+ _write_index_file(content_type)
88
87
 
89
- # Check if index.md is already first in TOC
90
- if not toc or toc[0].get("file") != "index.md":
91
- # Prepend index.md to TOC in myst.yml
92
- new_toc = [{"file": "index.md"}, *toc]
93
- if "project" not in myst_data:
94
- myst_data["project"] = {}
95
- myst_data["project"]["toc"] = new_toc
96
- write_yaml(myst_yml_path, myst_data)
97
- click.echo(f"Added index.md to TOC in {myst_yml_path}")
88
+ # Prepend index.md to TOC in myst.yml (skip if already first).
89
+ myst_data = read_yaml(myst_yml_path) or {}
90
+ toc = myst_data.get("project", {}).get("toc", [])
91
+ if not toc or toc[0].get("file") != "index.md":
92
+ myst_data.setdefault("project", {})["toc"] = [{"file": "index.md"}, *toc]
93
+ write_yaml(myst_yml_path, myst_data)
94
+ click.echo(f"Added index.md to TOC in {myst_yml_path}")
98
95
 
99
96
 
100
97
  def delete_placeholder_index_md_files():
@@ -63,6 +63,11 @@ jobs:
63
63
  - name: Install afterpython
64
64
  run: uv pip install --system afterpython
65
65
 
66
+ - name: Install marimo
67
+ # Needed by `ap build` when afterpython/README.py is a marimo notebook;
68
+ # afterpython shells out to the `marimo` CLI for the WASM export.
69
+ run: uv pip install --system marimo
70
+
66
71
  - name: Install website dependencies
67
72
  run: pnpm install
68
73
  working-directory: ./afterpython/_website
@@ -143,14 +143,11 @@ def _write_index_file(content_type: tContentType):
143
143
  f"and update the reference in afterpython/{content_type}/myst.yml."
144
144
  )
145
145
 
146
- index_content = f"""---
147
- title: ← {content_type.capitalize()}
148
- ---
146
+ # Lazy import to avoid the circular dep with builders/index_md.py, which
147
+ # already lazy-imports _write_index_file from this module.
148
+ from afterpython.builders.index_md import _placeholder_content
149
149
 
150
- {PLACEHOLDER_INDEX_MARKER}
151
-
152
- This is a placeholder index page. The actual {content_type} landing page is rendered by SvelteKit.
153
- """
150
+ index_content = _placeholder_content(content_type)
154
151
  index_file.write_text(index_content)
155
152
  return index_file
156
153
 
File without changes