Skip to content

Commit b857467

Browse files
committed
chore: Template upgrade
1 parent 7721103 commit b857467

9 files changed

Lines changed: 61 additions & 12 deletions

File tree

.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.21
2+
_commit: 0.16.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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
pull_request:
66
branches:
7-
- master
7+
- main
88

99
defaults:
1010
run:
@@ -25,6 +25,9 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v3
2727

28+
- name: Fetch all tags
29+
run: git fetch --depth=1 --tags
30+
2831
- name: Set up PDM
2932
uses: pdm-project/setup-pdm@v3
3033
with:
@@ -77,6 +80,7 @@ jobs:
7780
uses: pdm-project/setup-pdm@v3
7881
with:
7982
python-version: ${{ matrix.python-version }}
83+
allow-python-prereleases: true
8084

8185
- name: Resolving dependencies
8286
run: pdm lock -v --no-cross-platform -G ci-tests

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: release
2+
3+
on: push
4+
permissions:
5+
contents: write
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
if: startsWith(github.ref, 'refs/tags/')
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Fetch all tags
15+
run: git fetch --depth=1 --tags
16+
- name: Setup Python
17+
uses: actions/setup-python@v4
18+
- name: Install git-changelog
19+
run: pip install git-changelog
20+
- name: Prepare release notes
21+
run: git-changelog --release-notes > release-notes.md
22+
- name: Create release
23+
uses: softprops/action-gh-release@v1
24+
with:
25+
body_path: release-notes.md

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ git commit --fixup=SHA
137137
Once all the changes are approved, you can squash your commits:
138138

139139
```bash
140-
git rebase -i --autosquash master
140+
git rebase -i --autosquash main
141141
```
142142

143143
And force-push:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL := help
22
SHELL := bash
33
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty
4-
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11
4+
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11 3.12
55

66
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
77
check_quality_args = files

config/ruff.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ def merge(d1: Any, d2: Any) -> Any: # noqa: D103
5353

5454

5555
def mkdocs_config() -> str: # noqa: D103
56-
from mkdocs import utils
56+
import mergedeep
5757

58-
# patch YAML loader to merge arrays
59-
utils.merge = merge
58+
# force YAML loader to merge arrays
59+
mergedeep.merge = merge
6060

6161
if "+insiders" in pkgversion("mkdocs-material"):
6262
return "mkdocs.insiders.yml"
@@ -108,6 +108,7 @@ def check_quality(ctx: Context) -> None:
108108
ctx.run(
109109
ruff.check(*PY_SRC_LIST, config="config/ruff.toml"),
110110
title=pyprefix("Checking code quality"),
111+
command=f"ruff check --config config/ruff.toml {PY_SRC}",
111112
)
112113

113114

@@ -125,7 +126,11 @@ def check_dependencies(ctx: Context) -> None:
125126
allow_overrides=False,
126127
)
127128

128-
ctx.run(safety.check(requirements), title="Checking dependencies")
129+
ctx.run(
130+
safety.check(requirements),
131+
title="Checking dependencies",
132+
command="pdm export -f requirements --without-hashes | safety check --stdin",
133+
)
129134

130135

131136
@duty
@@ -137,7 +142,12 @@ def check_docs(ctx: Context) -> None:
137142
"""
138143
Path("htmlcov").mkdir(parents=True, exist_ok=True)
139144
Path("htmlcov/index.html").touch(exist_ok=True)
140-
ctx.run(mkdocs.build(strict=True, config_file=mkdocs_config()), title=pyprefix("Building documentation"))
145+
config = mkdocs_config()
146+
ctx.run(
147+
mkdocs.build(strict=True, config_file=config, verbose=True),
148+
title=pyprefix("Building documentation"),
149+
command=f"mkdocs build -vsf {config}",
150+
)
141151

142152

143153
@duty
@@ -150,6 +160,7 @@ def check_types(ctx: Context) -> None:
150160
ctx.run(
151161
mypy.run(*PY_SRC_LIST, config_file="config/mypy.ini"),
152162
title=pyprefix("Type-checking"),
163+
command=f"mypy --config-file config/mypy.ini {PY_SRC}",
153164
)
154165

155166

@@ -164,8 +175,9 @@ def check_api(ctx: Context) -> None:
164175

165176
griffe_check = lazy(g_check, name="griffe.check")
166177
ctx.run(
167-
griffe_check("mkdocs_autorefs", search_paths=["src"]),
178+
griffe_check("mkdocs_autorefs", search_paths=["src"], color=True),
168179
title="Checking for API breaking changes",
180+
command="griffe check -ssrc mkdocs_autorefs",
169181
nofail=True,
170182
)
171183

@@ -281,4 +293,5 @@ def test(ctx: Context, match: str = "") -> None:
281293
ctx.run(
282294
pytest.run("-n", "auto", "tests", config_file="config/pytest.ini", select=match, color="yes"),
283295
title=pyprefix("Running tests"),
296+
command=f"pytest -c config/pytest.ini -n auto -k{match!r} --color=yes tests",
284297
)

mkdocs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ repo_name: "mkdocstrings/autorefs"
66
site_dir: "site"
77
watch: [mkdocs.yml, README.md, CONTRIBUTING.md, CHANGELOG.md, src/mkdocs_autorefs]
88
copyright: Copyright © 2019 Oleh Prypin, 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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.9",
2626
"Programming Language :: Python :: 3.10",
2727
"Programming Language :: Python :: 3.11",
28+
"Programming Language :: Python :: 3.12",
2829
"Topic :: Documentation",
2930
"Topic :: Software Development",
3031
"Topic :: Software Development :: Documentation",
@@ -66,7 +67,7 @@ docs = [
6667
"black>=23.1",
6768
"markdown-callouts>=0.2",
6869
"markdown-exec>=0.5",
69-
"mkdocs>=1.3",
70+
"mkdocs>=1.5",
7071
"mkdocs-coverage>=0.2",
7172
"mkdocs-gen-files>=0.3",
7273
"mkdocs-git-committers-plugin-2>=1.1",

0 commit comments

Comments
 (0)