Skip to content

Commit 4f3d959

Browse files
authored
Merge pull request #164 from python-project-templates/copier-update-2026-10-11T11-26-44Z
Update from Copier (2026-10-11T11-26-44Z)
2 parents 6200da3 + f18935b commit 4f3d959

14 files changed

Lines changed: 65 additions & 62 deletions

File tree

‎.copier-answers.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: ebb6e1c
2+
_commit: '4372075'
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: false
55
add_extension: python

‎.github/workflows/build.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
workflow_dispatch:
1616

1717
concurrency:
18-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
2020

2121
permissions:

‎Makefile‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ lint-py: ## lint python with ruff
2525
python -m ruff format --check yardang
2626

2727
lint-docs: ## lint docs with mdformat and codespell
28-
python -m mdformat --check README.md
29-
python -m codespell_lib README.md
28+
python -m mdformat --check README.md $(wildcard docs/src)
29+
python -m codespell_lib README.md $(wildcard docs/src)
3030

3131
fix-py: ## autoformat python code with ruff
3232
python -m ruff check --fix yardang
3333
python -m ruff format yardang
3434

3535
fix-docs: ## autoformat docs with mdformat and codespell
36-
python -m mdformat README.md
37-
python -m codespell_lib --write README.md
36+
python -m mdformat README.md $(wildcard docs/src)
37+
python -m codespell_lib --write README.md $(wildcard docs/src)
3838

3939
lint: lint-py lint-docs ## run all linters
4040
lints: lint
@@ -52,7 +52,7 @@ check-dist: ## check python sdist and wheel with check-dist
5252
check-types: ## check python types with ty
5353
ty check --python $$(which python)
5454

55-
checks: check-dist
55+
checks: check-dist check-types
5656

5757
# Alias
5858
check: checks

‎docs/src/api.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,3 @@ Use `js:autoclass` to document classes:
118118
:members:
119119
120120
```
121-

‎docs/src/configuration.md‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pages = [
1616
]
1717
use-autoapi = true
1818
```
19+
1920
## [`name`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-project)
2021

2122
The project name is taken from the standard section, or from the `cwd`.
@@ -101,22 +102,22 @@ theme = "fuma"
101102
html_theme_options = { github_url = "https://github.com/you/project", toc_style = "clerk" }
102103
```
103104

104-
| Option | Default | Description |
105-
| --- | --- | --- |
106-
| `layout` | `docs` | `docs` puts the header beside the sidebar; `notebook` spans it across the top. |
107-
| `toc_style` | `normal` | `clerk` dims headings away from the current one. |
108-
| `color_preset` | `neutral` | Accent colour: `neutral`, `amber`, `blue`, `emerald`, `purple`, `rose`. |
109-
| `fonts` | `bundled` | `system` skips the bundled webfonts and uses the system stack. |
110-
| `search` | `true` | Enables the search dialog and its index. |
111-
| `sidebar_hide_name` | `false` | Hides the project name next to the logo. |
112-
| `default_open_level` | `1` | Sidebar folder depth expanded by default. |
113-
| `github_url` | — | Adds a GitHub link, and an "Edit this page" link. |
114-
| `edit_page_url_template` | — | Overrides the edit link, e.g. `https://host/edit/main/{filename}`. |
115-
| `nav_links` | — | Header links, as `[{title, url}]` or `"Title\|url, Title\|url"`. |
116-
| `sidebar_tabs` | — | Navigator entries under the search box, as `[{title, url, description, icon, match}]`. |
117-
| `announcement` | — | Banner text shown above the header. |
118-
| `footer_text` | — | Extra line in the footer. |
119-
| `light_css_variables` / `dark_css_variables` | — | CSS custom property overrides, e.g. `{ "color-fd-primary" = "#e11d48" }`. |
105+
| Option | Default | Description |
106+
| -------------------------------------------- | --------- | -------------------------------------------------------------------------------------- |
107+
| `layout` | `docs` | `docs` puts the header beside the sidebar; `notebook` spans it across the top. |
108+
| `toc_style` | `normal` | `clerk` dims headings away from the current one. |
109+
| `color_preset` | `neutral` | Accent colour: `neutral`, `amber`, `blue`, `emerald`, `purple`, `rose`. |
110+
| `fonts` | `bundled` | `system` skips the bundled webfonts and uses the system stack. |
111+
| `search` | `true` | Enables the search dialog and its index. |
112+
| `sidebar_hide_name` | `false` | Hides the project name next to the logo. |
113+
| `default_open_level` | `1` | Sidebar folder depth expanded by default. |
114+
| `github_url` | — | Adds a GitHub link, and an "Edit this page" link. |
115+
| `edit_page_url_template` | — | Overrides the edit link, e.g. `https://host/edit/main/{filename}`. |
116+
| `nav_links` | — | Header links, as `[{title, url}]` or `"Title\|url, Title\|url"`. |
117+
| `sidebar_tabs` | — | Navigator entries under the search box, as `[{title, url, description, icon, match}]`. |
118+
| `announcement` | — | Banner text shown above the header. |
119+
| `footer_text` | — | Extra line in the footer. |
120+
| `light_css_variables` / `dark_css_variables` | — | CSS custom property overrides, e.g. `{ "color-fd-primary" = "#e11d48" }`. |
120121

121122
#### Content components
122123

@@ -400,7 +401,6 @@ language = "en"
400401
pygments_style = "sphinx"
401402
```
402403

403-
404404
## [Myst](https://myst-parser.readthedocs.io/en/latest/#)
405405

406406
```toml
@@ -531,7 +531,6 @@ mindmap
531531
Mermaid
532532
```
533533

534-
535534
## GitHub Admonitions
536535

537536
GitHub admonitions are automatically translated to sphinx.
@@ -835,7 +834,7 @@ rustdoc-fmt = { mylib-utils = "rst" }
835834

836835
The pages are generated for you, so your documentation files only need a toctree entry pointing at them:
837836

838-
````markdown
837+
```markdown
839838
# API Reference
840839

841840
\`\`\`{toctree}
@@ -844,7 +843,7 @@ The pages are generated for you, so your documentation files only need a toctree
844843
/api/mylib/lib
845844
/api/mylib-utils/lib
846845
\`\`\`
847-
````
846+
```
848847

849848
## Sphinx-JS Integration
850849

@@ -941,7 +940,7 @@ ts-type-bold = true
941940

942941
Then in your documentation files, you can use sphinx-js directives:
943942

944-
````markdown
943+
```markdown
945944
# API Reference
946945

947946
## Functions
@@ -959,7 +958,7 @@ Then in your documentation files, you can use sphinx-js directives:
959958

960959
\`\`\`{js:automodule} myModule
961960
\`\`\`
962-
````
961+
```
963962

964963
## GitHub Wiki Integration
965964

@@ -1123,6 +1122,7 @@ git push
11231122
```
11241123

11251124
The generated wiki includes:
1125+
11261126
- `Home.md` - The main landing page (converted from index.md)
11271127
- `_Sidebar.md` - Navigation sidebar with links to all pages
11281128
- `_Footer.md` - Footer with links to documentation and repository

‎docs/src/home.md‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
<div style="display: flex; flex-direction: row; margin-top:50px;">
42
<a href="https://github.com/python-project-templates/yardang"><img src="https://github.com/python-project-templates/yardang/blob/main/docs/logo.png?raw=true" alt="yardang" width="120"></a>
53
<h1 style="margin-left: 20px;">yardang</h1>
@@ -15,7 +13,6 @@
1513

1614
[`yardang`](https://www.britannica.com/science/yardang) makes building [Sphinx](https://www.sphinx-doc.org/en/master/) easy.
1715

18-
1916
::::{grid} 1 2 2 2
2017
:margin: 4 4 0 0
2118
:gutter: 1
@@ -49,6 +46,6 @@ Star, Fork, or contribute on GitHub.
4946
:::
5047
::::
5148

52-
-------------
49+
______________________________________________________________________
5350

5451
*This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).*

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ develop = [
7373
"codespell",
7474
"hatchling",
7575
"mdformat",
76+
"mdformat-frontmatter",
7677
"mdformat-tables>=1",
7778
"pytest",
7879
"pytest-cov",
@@ -117,7 +118,7 @@ replace = 'version = "{new_version}"'
117118
[tool.coverage.run]
118119
branch = true
119120
omit = [
120-
"yardang/tests/integration/",
121+
"yardang/tests/integration/*",
121122
]
122123

123124
[tool.coverage.report]

‎yardang/build.py‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ def customize(args):
298298
custom_css = custom_css if custom_css is not None else get_config_flex(section="custom-css", base=config_base)
299299
custom_js = custom_js if custom_js is not None else get_config_flex(section="custom-js", base=config_base)
300300
assets_dir = Path(__file__).parent
301-
custom_css = _resolve_custom_asset(custom_css, theme, "css", assets_dir=assets_dir)
302-
custom_js = _resolve_custom_asset(custom_js, theme, "js", assets_dir=assets_dir)
301+
custom_css_content = _resolve_custom_asset(custom_css, theme, "css", assets_dir=assets_dir)
302+
custom_js_content = _resolve_custom_asset(custom_js, theme, "js", assets_dir=assets_dir)
303303

304304
source_dir = source_dir or get_config_flex(section="source-dir", base=config_base)
305305
existing_source = source_dir is not None
@@ -635,10 +635,10 @@ def customize(args):
635635
html_output = Path(html_output_dir) if html_output_dir is not None else Path("docs/html")
636636
styles_dir = html_output / "_static" / "styles"
637637
styles_dir.mkdir(parents=True, exist_ok=True)
638-
(styles_dir / "custom.css").write_text(custom_css or "")
638+
(styles_dir / "custom.css").write_text(custom_css_content or "")
639639
js_dir = html_output / "_static" / "js"
640640
js_dir.mkdir(parents=True, exist_ok=True)
641-
(js_dir / "custom.js").write_text(custom_js or "")
641+
(js_dir / "custom.js").write_text(custom_js_content or "")
642642

643643
# append docs-specific ignores to gitignore
644644
if not existing_source and Path(".gitignore").exists():
@@ -665,23 +665,23 @@ def customize(args):
665665
@contextmanager
666666
def generate_wiki_configuration(
667667
*,
668-
project: str = "",
669-
title: str = "",
670-
module: str = "",
671-
description: str = "",
672-
author: str = "",
673-
copyright: str = "",
674-
version: str = "",
675-
theme: str = "furo",
676-
docs_root: str = "",
677-
root: str = "",
678-
cname: str = "",
668+
project: str | None = "",
669+
title: str | None = "",
670+
module: str | None = "",
671+
description: str | None = "",
672+
author: str | None = "",
673+
copyright: str | None = "",
674+
version: str | None = "",
675+
theme: str | None = "furo",
676+
docs_root: str | None = "",
677+
root: str | None = "",
678+
cname: str | None = "",
679679
pages: list | None = None,
680680
use_autoapi: bool | None = None,
681681
autoapi_ignore: list | None = None,
682682
custom_css: Path | None = None,
683683
custom_js: Path | None = None,
684-
config_base: str = "tool.yardang",
684+
config_base: str | None = "tool.yardang",
685685
previous_versions: bool | None = False,
686686
adjust_arguments: Callable | None = None,
687687
adjust_template: Callable | None = None,

‎yardang/cli.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def build(
7272
sleep(0.1)
7373
if process.returncode != 0:
7474
if pdb:
75-
import pdb # noqa: T100
75+
import pdb as debugger # noqa: T100
7676

77-
pdb.set_trace() # noqa: T100
77+
debugger.set_trace() # noqa: T100
7878
raise Exit(process.returncode)
7979

8080

@@ -170,9 +170,9 @@ def wiki(
170170
sleep(0.1)
171171
if process.returncode != 0:
172172
if pdb:
173-
import pdb # noqa: T100
173+
import pdb as debugger # noqa: T100
174174

175-
pdb.set_trace() # noqa: T100
175+
debugger.set_trace() # noqa: T100
176176
raise Exit(process.returncode)
177177

178178
# Post-process for GitHub Wiki compatibility

‎yardang/sphinx/llms.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from pathlib import Path
2+
from typing import cast
23
from urllib.parse import urlsplit, urlunsplit
34

45
from docutils import nodes
56
from sphinx.application import Sphinx
7+
from sphinx.builders import Builder
68
from sphinx_markdown_builder.builder import MarkdownBuilder
79
from sphinx_markdown_builder.translator import MarkdownTranslator
810

@@ -42,7 +44,7 @@ def __init__(self, app: Sphinx):
4244
self.current_doc_name = ""
4345

4446
def create_translator(self, *args):
45-
return self.app.registry.create_translator(self, *args)
47+
return self.app.registry.create_translator(cast(Builder, self), *args)
4648

4749
@staticmethod
4850
def get_target_uri(docname: str, typ: str | None = None) -> str:

0 commit comments

Comments
 (0)