Skip to content

Commit 8573730

Browse files
committed
chore: Template upgrade
1 parent 343a8da commit 8573730

File tree

7 files changed

+35
-14
lines changed

7 files changed

+35
-14
lines changed

.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 0.15.23
2+
_commit: 0.16.5
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli

.github/workflows/ci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ name: ci
22

33
on:
44
push:
5-
branches:
6-
- main
75
pull_request:
86
branches:
9-
- main
7+
- main
108

119
defaults:
1210
run:

.github/workflows/release.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
name: release
22

33
on: push
4+
permissions:
5+
contents: write
46

57
jobs:
6-
github_release:
8+
release:
79
runs-on: ubuntu-latest
810
if: startsWith(github.ref, 'refs/tags/')
911
steps:
1012
- name: Checkout
1113
uses: actions/checkout@v3
14+
- name: Fetch all tags
15+
run: git fetch --depth=1 --tags
1216
- name: Setup Python
1317
uses: actions/setup-python@v4
1418
- name: Install git-changelog
1519
run: pip install git-changelog
1620
- name: Prepare release notes
1721
run: git-changelog --release-notes > release-notes.md
18-
- name: Create GitHub release
22+
- name: Create release
1923
uses: softprops/action-gh-release@v1
2024
with:
2125
body_path: release-notes.md

config/ruff.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target-version = "py37"
1+
target-version = "py38"
22
line-length = 132
33
exclude = [
44
"fixtures",

duties.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ def merge(d1: Any, d2: Any) -> Any: # noqa: D103
4848

4949

5050
def mkdocs_config() -> str: # noqa: D103
51-
from mkdocs import utils
51+
import mergedeep
5252

53-
# patch YAML loader to merge arrays
54-
utils.merge = merge
53+
# force YAML loader to merge arrays
54+
mergedeep.merge = merge
5555

5656
if "+insiders" in pkgversion("mkdocs-material"):
5757
return "mkdocs.insiders.yml"
@@ -103,6 +103,7 @@ def check_quality(ctx: Context) -> None:
103103
ctx.run(
104104
ruff.check(*PY_SRC_LIST, config="config/ruff.toml"),
105105
title=pyprefix("Checking code quality"),
106+
command=f"ruff check --config config/ruff.toml {PY_SRC}",
106107
)
107108

108109

@@ -120,7 +121,11 @@ def check_dependencies(ctx: Context) -> None:
120121
allow_overrides=False,
121122
)
122123

123-
ctx.run(safety.check(requirements), title="Checking dependencies")
124+
ctx.run(
125+
safety.check(requirements),
126+
title="Checking dependencies",
127+
command="pdm export -f requirements --without-hashes | safety check --stdin",
128+
)
124129

125130

126131
@duty
@@ -132,7 +137,12 @@ def check_docs(ctx: Context) -> None:
132137
"""
133138
Path("htmlcov").mkdir(parents=True, exist_ok=True)
134139
Path("htmlcov/index.html").touch(exist_ok=True)
135-
ctx.run(mkdocs.build(strict=True, config_file=mkdocs_config()), title=pyprefix("Building documentation"))
140+
config = mkdocs_config()
141+
ctx.run(
142+
mkdocs.build(strict=True, config_file=config, verbose=True),
143+
title=pyprefix("Building documentation"),
144+
command=f"mkdocs build -vsf {config}",
145+
)
136146

137147

138148
@duty
@@ -145,6 +155,7 @@ def check_types(ctx: Context) -> None:
145155
ctx.run(
146156
mypy.run(*PY_SRC_LIST, config_file="config/mypy.ini"),
147157
title=pyprefix("Type-checking"),
158+
command=f"mypy --config-file config/mypy.ini {PY_SRC}",
148159
)
149160

150161

@@ -159,8 +170,9 @@ def check_api(ctx: Context) -> None:
159170

160171
griffe_check = lazy(g_check, name="griffe.check")
161172
ctx.run(
162-
griffe_check("git_changelog", search_paths=["src"]),
173+
griffe_check("git_changelog", search_paths=["src"], color=True),
163174
title="Checking for API breaking changes",
175+
command="griffe check -ssrc git_changelog",
164176
nofail=True,
165177
)
166178

@@ -276,4 +288,5 @@ def test(ctx: Context, match: str = "") -> None:
276288
ctx.run(
277289
pytest.run("-n", "auto", "tests", config_file="config/pytest.ini", select=match, color="yes"),
278290
title=pyprefix("Running tests"),
291+
command=f"pytest -c config/pytest.ini -n auto -k{match!r} --color=yes tests",
279292
)

mkdocs.yml

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ repo_name: "pawamoy/git-changelog"
66
site_dir: "site"
77
watch: [mkdocs.yml, README.md, CONTRIBUTING.md, CHANGELOG.md, src/git_changelog]
88
copyright: Copyright © 2020 Timothée Mazzucotelli
9+
edit_uri: edit/main/docs/
10+
11+
validation:
12+
omitted_files: warn
13+
absolute_links: warn
14+
unrecognized_links: warn
915

1016
nav:
1117
- Home:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ docs = [
6969
"black>=23.1",
7070
"markdown-callouts>=0.2",
7171
"markdown-exec>=0.5",
72-
"mkdocs>=1.3",
72+
"mkdocs>=1.5",
7373
"mkdocs-coverage>=0.2",
7474
"mkdocs-gen-files>=0.3",
7575
"mkdocs-git-committers-plugin-2>=1.1",

0 commit comments

Comments
 (0)