Skip to content

Commit 4c3290d

Browse files
committed
chore: Template upgrade
1 parent 79e1516 commit 4c3290d

File tree

14 files changed

+144
-184
lines changed

14 files changed

+144
-184
lines changed

.copier-answers.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier.
2-
_commit: 1.8.4
2+
_commit: 1.11.2
33
_src_path: gh:pawamoy/copier-uv
44
author_email: dev@pawamoy.fr
55
author_fullname: Timothée Mazzucotelli
@@ -8,7 +8,6 @@ copyright_date: '2021'
88
copyright_holder: Timothée Mazzucotelli
99
copyright_holder_email: dev@pawamoy.fr
1010
copyright_license: ISC
11-
insiders: false
1211
project_description: A legacy Python handler for mkdocstrings.
1312
project_name: mkdocstrings-python (legacy)
1413
python_package_command_line_name: ''

.github/ISSUE_TEMPLATE/1-bug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ PASTE TRACEBACK HERE
5050
redacting sensitive information. -->
5151

5252
```bash
53-
python -m mkdocstrings_handlers.python._internal.debug # | xclip -selection clipboard
53+
python -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard
5454
```
5555

5656
PASTE MARKDOWN OUTPUT HERE

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### For reviewers
2+
<!-- Help reviewers by letting them know whether AI was used to create this PR. -->
3+
4+
- [ ] I did not use AI
5+
- [ ] I used AI and thoroughly reviewed every code/docs change
6+
7+
### Description of the change
8+
<!-- Quick sentence for small changes, longer description for more impacting changes. -->
9+
10+
### Relevant resources
11+
<!-- Link to any relevant GitHub issue, PR or discussion, section in online docs, etc. -->
12+
13+
-
14+
-
15+
-

.github/workflows/ci.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ name: ci
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- test-me-*
58
pull_request:
69
branches:
710
- main
811

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
916
defaults:
1017
run:
1118
shell: bash
@@ -14,13 +21,30 @@ env:
1421
LANG: en_US.utf-8
1522
LC_ALL: en_US.utf-8
1623
PYTHONIOENCODING: UTF-8
24+
PYTHONWARNDEFAULTENCODING: "1"
1725
PYTHON_VERSIONS: ""
1826

1927
jobs:
2028

2129
quality:
30+
strategy:
31+
matrix:
32+
os:
33+
- ubuntu-latest
34+
- macos-latest
35+
- windows-latest
36+
python-version:
37+
- "3.10"
38+
- "3.14"
39+
include:
40+
- os: ubuntu-latest
41+
python-version: "3.11"
42+
- os: ubuntu-latest
43+
python-version: "3.12"
44+
- os: ubuntu-latest
45+
python-version: "3.13"
2246

23-
runs-on: ubuntu-latest
47+
runs-on: ${{ matrix.os }}
2448

2549
steps:
2650
- name: Checkout
@@ -30,9 +54,9 @@ jobs:
3054
fetch-tags: true
3155

3256
- name: Setup Python
33-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
3458
with:
35-
python-version: "3.12"
59+
python-version: ${{ matrix.python-version }}
3660

3761
- name: Setup uv
3862
uses: astral-sh/setup-uv@v5
@@ -57,6 +81,7 @@ jobs:
5781

5882
- name: Store objects inventory for tests
5983
uses: actions/upload-artifact@v4
84+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' }}
6085
with:
6186
name: objects.inv
6287
path: site/objects.inv
@@ -72,12 +97,12 @@ jobs:
7297
- macos-latest
7398
- windows-latest
7499
python-version:
75-
- "3.9"
76100
- "3.10"
77101
- "3.11"
78102
- "3.12"
79103
- "3.13"
80104
- "3.14"
105+
- "3.15"
81106
resolution:
82107
- highest
83108
- lowest-direct
@@ -87,7 +112,7 @@ jobs:
87112
- os: windows-latest
88113
resolution: lowest-direct
89114
runs-on: ${{ matrix.os }}
90-
continue-on-error: ${{ matrix.python-version == '3.14' }}
115+
continue-on-error: true
91116

92117
steps:
93118
- name: Checkout
@@ -97,7 +122,7 @@ jobs:
97122
fetch-tags: true
98123

99124
- name: Setup Python
100-
uses: actions/setup-python@v5
125+
uses: actions/setup-python@v6
101126
with:
102127
python-version: ${{ matrix.python-version }}
103128
allow-prereleases: true

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
fetch-depth: 0
1616
fetch-tags: true
1717
- name: Setup Python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
20-
python-version: "3.12"
20+
python-version: "3.13"
2121
- name: Setup uv
2222
uses: astral-sh/setup-uv@v5
2323
- name: Prepare release notes
@@ -26,3 +26,4 @@ jobs:
2626
uses: softprops/action-gh-release@v2
2727
with:
2828
body_path: release-notes.md
29+

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# the `make` command will point at the `scripts/make` shell script.
33
# This Makefile is just here to allow auto-completion in the terminal.
44

5+
default: help
6+
@echo
7+
@echo 'Enable direnv in your shell to use the `make` command: `direnv allow`'
8+
@echo 'Or use `python scripts/make ARGS` to run the commands/tasks directly.'
9+
10+
.DEFAULT_GOAL: default
11+
512
actions = \
613
allrun \
714
changelog \

config/pytest.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ addopts =
66
--cov-config config/coverage.ini
77
testpaths =
88
tests
9+
10+
# action:message_regex:warning_class:module_regex:line
11+
filterwarnings =
12+
error
13+
default::EncodingWarning
14+
error::EncodingWarning:mkdocstrings_handlers
15+
# TODO: remove once pytest-xdist 4 is released
16+
ignore:.*rsyncdir:DeprecationWarning:xdist

duties.py

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
import os
66
import re
77
import sys
8-
from contextlib import contextmanager
9-
from importlib.metadata import version as pkgversion
108
from pathlib import Path
119
from typing import TYPE_CHECKING
1210

1311
from duty import duty, tools
1412

1513
if TYPE_CHECKING:
16-
from collections.abc import Iterator
17-
1814
from duty.context import Context
1915

2016

@@ -25,6 +21,8 @@
2521
WINDOWS = os.name == "nt"
2622
PTY = not WINDOWS and not CI
2723
MULTIRUN = os.environ.get("MULTIRUN", "0") == "1"
24+
PY_VERSION = f"{sys.version_info.major}{sys.version_info.minor}"
25+
PY_DEV = "314"
2826

2927

3028
def pyprefix(title: str) -> str:
@@ -34,18 +32,6 @@ def pyprefix(title: str) -> str:
3432
return title
3533

3634

37-
@contextmanager
38-
def material_insiders() -> Iterator[bool]:
39-
if "+insiders" in pkgversion("mkdocs-material"):
40-
os.environ["MATERIAL_INSIDERS"] = "true"
41-
try:
42-
yield True
43-
finally:
44-
os.environ.pop("MATERIAL_INSIDERS")
45-
else:
46-
yield False
47-
48-
4935
def _get_changelog_version() -> str:
5036
changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
5137
with Path(__file__).parent.joinpath("CHANGELOG.md").open("r", encoding="utf8") as file:
@@ -68,7 +54,7 @@ def check(ctx: Context) -> None:
6854
"""Check it all!"""
6955

7056

71-
@duty
57+
@duty(nofail=PY_VERSION == PY_DEV)
7258
def check_quality(ctx: Context) -> None:
7359
"""Check the code quality."""
7460
ctx.run(
@@ -77,19 +63,18 @@ def check_quality(ctx: Context) -> None:
7763
)
7864

7965

80-
@duty
66+
@duty(nofail=PY_VERSION == PY_DEV)
8167
def check_docs(ctx: Context) -> None:
8268
"""Check if the documentation builds correctly."""
8369
Path("htmlcov").mkdir(parents=True, exist_ok=True)
8470
Path("htmlcov/index.html").touch(exist_ok=True)
85-
with material_insiders():
86-
ctx.run(
87-
tools.mkdocs.build(strict=True, verbose=True),
88-
title=pyprefix("Building documentation"),
89-
)
71+
ctx.run(
72+
tools.mkdocs.build(strict=True, verbose=True),
73+
title=pyprefix("Building documentation"),
74+
)
9075

9176

92-
@duty
77+
@duty(nofail=PY_VERSION == PY_DEV)
9378
def check_types(ctx: Context) -> None:
9479
"""Check that the code is correctly typed."""
9580
os.environ["MYPYPATH"] = "src"
@@ -100,7 +85,7 @@ def check_types(ctx: Context) -> None:
10085
)
10186

10287

103-
@duty
88+
@duty(nofail=PY_VERSION == PY_DEV)
10489
def check_api(ctx: Context, *cli_args: str) -> None:
10590
"""Check for API breaking changes."""
10691
ctx.run(
@@ -118,22 +103,18 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
118103
host: The host to serve the docs from.
119104
port: The port to serve the docs on.
120105
"""
121-
with material_insiders():
122-
ctx.run(
123-
tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args),
124-
title="Serving documentation",
125-
capture=False,
126-
)
106+
ctx.run(
107+
tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args),
108+
title="Serving documentation",
109+
capture=False,
110+
)
127111

128112

129113
@duty
130114
def docs_deploy(ctx: Context) -> None:
131115
"""Deploy the documentation to GitHub pages."""
132116
os.environ["DEPLOY"] = "true"
133-
with material_insiders() as insiders:
134-
if not insiders:
135-
ctx.run(lambda: False, title="Not deploying docs without Material for MkDocs Insiders!")
136-
ctx.run(tools.mkdocs.gh_deploy(), title="Deploying documentation")
117+
ctx.run(tools.mkdocs.gh_deploy(force=True), title="Deploying documentation")
137118

138119

139120
@duty
@@ -180,7 +161,7 @@ def release(ctx: Context, version: str = "") -> None:
180161
ctx.run("false", title="A version must be provided")
181162
ctx.run("git add pyproject.toml CHANGELOG.md", title="Staging files", pty=PTY)
182163
ctx.run(["git", "commit", "-m", f"chore: Prepare release {version}"], title="Committing changes", pty=PTY)
183-
ctx.run(f"git tag {version}", title="Tagging commit", pty=PTY)
164+
ctx.run(f"git tag -m '' -a {version}", title="Tagging commit", pty=PTY)
184165
ctx.run("git push", title="Pushing commits", pty=False)
185166
ctx.run("git push --tags", title="Pushing tags", pty=False)
186167

@@ -193,20 +174,15 @@ def coverage(ctx: Context) -> None:
193174
ctx.run(tools.coverage.html(rcfile="config/coverage.ini"))
194175

195176

196-
@duty
197-
def test(ctx: Context, *cli_args: str, match: str = "") -> None:
198-
"""Run the test suite.
199-
200-
Parameters:
201-
match: A pytest expression to filter selected tests.
202-
"""
203-
py_version = f"{sys.version_info.major}{sys.version_info.minor}"
204-
os.environ["COVERAGE_FILE"] = f".coverage.{py_version}"
177+
@duty(nofail=PY_VERSION == PY_DEV)
178+
def test(ctx: Context, *cli_args: str) -> None:
179+
"""Run the test suite."""
180+
os.environ["COVERAGE_FILE"] = f".coverage.{PY_VERSION}"
181+
os.environ["PYTHONWARNDEFAULTENCODING"] = "1"
205182
ctx.run(
206183
tools.pytest(
207184
"tests",
208185
config_file="config/pytest.ini",
209-
select=match,
210186
color="yes",
211187
).add_args("-n", "auto", *cli_args),
212188
title=pyprefix("Running tests"),

mkdocs.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,7 @@ plugins:
145145
type: timeago
146146
- minify:
147147
minify_html: !ENV [DEPLOY, false]
148-
- group:
149-
enabled: !ENV [MATERIAL_INSIDERS, false]
150-
plugins:
151-
- typeset
148+
- typeset
152149

153150
extra:
154151
social:

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors = [{name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr"}]
99
license = "ISC"
1010
license-files = ["LICENSE"]
1111
readme = "README.md"
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.10"
1313
keywords = []
1414
dynamic = ["version"]
1515
classifiers = [
@@ -18,7 +18,6 @@ classifiers = [
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
2020
"Programming Language :: Python :: 3 :: Only",
21-
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",
2423
"Programming Language :: Python :: 3.12",

0 commit comments

Comments
 (0)