8000 chore: Template upgrade · AntoineD/mkdocstrings-python@2d41813 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d41813

Browse files
committed
chore: Template upgrade
1 parent 5852612 commit 2d41813

File tree

10 files changed

+44
-18
lines changed

10 files changed

+44
-18
lines changed

.copier-answers.yml

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: 0.15.2
2+
_commit: 0.15.5
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: pawamoy@pm.me
55
author_fullname: Timothée Mazzucotelli

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
python-version: "3.8"
3232

3333
- name: Resolving dependencies
34-
run: pdm lock -v
34+
run: pdm lock -v --no-cross-platform
3535

3636
- name: Install dependencies
3737
run: pdm install -G duty -G docs -G quality -G typing -G security
@@ -78,7 +78,7 @@ jobs:
7878
python-version: ${{ matrix.python-version }}
7979

8080
- name: Resolving dependencies
81-
run: pdm lock -v
81+
run: pdm lock -v --no-cross-platform
8282

8383
- name: Install dependencies
8484
run: pdm install --no-editable -G duty -G tests -G docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pip-wheel-metadata/
1212
site/
1313
pdm.lock
1414
pdm.toml
15+
.pdm-plugins/
1516
.pdm-python
1617
__pypackages__/
1718
.venv/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ help:
3232

3333
.PHONY: lock
3434
lock:
35-
@pdm lock
35+
@pdm lock --no-cross-platform
3636

3737
.PHONY: setup
3838
setup:

docs/css/mkdocstrings.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ div.doc-contents:not(.first) {
44
border-left: .05rem solid var(--md-typeset-table-color);
55
}
66

7-
/* Mark external links as such */
7+
/* Mark external links as such. */
88
a.external::after,
9 8000 9
a.autorefs-external::after {
1010
/* https://primer.style/octicons/arrow-up-right-24 */

duties.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import sys
77
from pathlib import Path
8-
from typing import TYPE_CHECKING
8+
from typing import TYPE_CHECKING, Any
99

1010
from duty import duty
1111
from duty.callables import black, blacken_docs, coverage, lazy, mkdocs, mypy, pytest, ruff, safety
@@ -35,7 +35,29 @@ def pyprefix(title: str) -> str: # noqa: D103
3535
return title
3636

3737

38+
def merge(d1: Any, d2: Any) -> Any: # noqa: D103
39+
basic_types = (int, float, str, bool, complex)
40+
if isinstance(d1, dict) and isinstance(d2, dict):
41+
for key, value in d2.items():
42+
if key in d1:
43+
if isinstance(d1[key], basic_types):
44+
d1[key] = value
45+
else:
46+
d1[key] = merge(d1[key], value)
47+
else:
48+
d1[key] = value
49+
return d1
50+
if isinstance(d1, list) and isinstance(d2, list):
51+
return d1 + d2
52+
return d2
53+
54+
3855
def mkdocs_config() -> str: # noqa: D103
56+
from mkdocs import utils
57+
58+
# patch YAML loader to merge arrays
59+
utils.merge = merge
60+
3961
if "+insiders" in pkgversion("mkdocs-material"):
4062
return "mkdocs.insiders.yml"
4163
return "mkdocs.yml"
@@ -83,6 +105,7 @@ def check_quality(ctx: Context) -> None:
83105
Parameters:
84106
ctx: The context instance (passed automatically).
85107
"""
108+
os.environ["MYPYPATH"] = "src"
86109
ctx.run(
87110
ruff.check(*PY_SRC_LIST, config="config/ruff.toml"),
88111
title=pyprefix("Checking code quality"),
@@ -125,7 +148,6 @@ def check_types(ctx: Context) -> None:
125148
Parameters:
126149
ctx: The context instance (passed automatically).
127150
"""
128-
os.environ["MYPYPATH"] = "src"
129151
ctx.run(
130152
mypy.run(*PY_SRC_LIST, config_file="config/mypy.ini"),
131153
title=pyprefix("Type-checking"),

mkdocs.insiders.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
INHERIT: mkdocs.yml
22

33
plugins:
4-
typeset: {}
4+
- typeset

mkdocs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ markdown_extensions:
119119
permalink: "¤"
120120

121121
plugins:
122-
autorefs: {}
123-
search: {}
124-
markdown-exec: {}
125-
gen-files:
122+
- autorefs
123+
- search
124+
- markdown-exec
125+
- gen-files:
126126
scripts:
127127
- scripts/gen_ref_nav.py
128-
literate-nav:
128+
- literate-nav:
129129
nav_file: SUMMARY.txt
130-
coverage: {}
131-
mkdocstrings:
130+
- coverage
131+
- mkdocstrings:
132132
handlers:
133133
python:
134134
paths: [src]
@@ -141,10 +141,10 @@ plugins:
141141
merge_init_into_class: true
142142
docstring_options:
143143
ignore_init_summary: true
144-
git-committers:
144+
- git-committers:
145145
enabled: !ENV [DEPLOY, false]
146146
repository: mkdocstrings/python
147-
minify:
147+
- minify:
148148
minify_html: !ENV [DEPLOY, false]
149149

150150
extra:

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Funding = "https://github.com/sponsors/mkdocstrings"
4545

4646
[tool.pdm]
4747
version = {source = "scm"}
48+
plugins = [
49+
"pdm-multirun",
50+
]
4851

4952
[tool.pdm.build]
5053
package-dir = "src"

scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if ! command -v pdm &>/dev/null; then
1010
pipx install pdm
1111
fi
1212
if ! pdm self list 2>/dev/null | grep -q pdm-multirun; then
13-
pipx inject pdm pdm-multirun
13+
pdm install --plugins
1414
fi
1515

1616
if [ -n "${PYTHON_VERSIONS}" ]; then

0 commit comments

Comments
 (0)
0