Skip to content

Commit 7ff77ce

Browse files
committed
chore: Template upgrade
1 parent 8e6927f commit 7ff77ce

22 files changed

+352
-325
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: 1.1.4
2+
_commit: 1.2.4
33
_src_path: gh:mkdocstrings/handler-template
44
author_email: dev@pawamoy.fr
55
author_fullname: Timothée Mazzucotelli

.github/workflows/ci.yml

+24-14
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
fetch-tags: true
2831

29-
- name: Fetch all tags
30-
run: git fetch --depth=1 --tags
31-
32-
- name: Set up Python
32+
- name: Setup Python
3333
uses: actions/setup-python@v5
3434
with:
35-
python-version: "3.11"
35+
python-version: "3.12"
3636

37-
- name: Install uv
38-
run: pip install uv
37+
- name: Setup uv
38+
uses: astral-sh/setup-uv@v3
39+
with:
40+
enable-cache: true
41+
cache-dependency-glob: pyproject.toml
3942

4043
- name: Install dependencies
4144
run: make setup
@@ -63,11 +66,11 @@ jobs:
6366
echo 'jobs=[
6467
{"os": "macos-latest"},
6568
{"os": "windows-latest"},
66-
{"python-version": "3.9"},
6769
{"python-version": "3.10"},
6870
{"python-version": "3.11"},
6971
{"python-version": "3.12"},
70-
{"python-version": "3.13"}
72+
{"python-version": "3.13"},
73+
{"python-version": "3.14"}
7174
]' | tr -d '[:space:]' >> $GITHUB_OUTPUT
7275
else
7376
echo 'jobs=[
@@ -86,31 +89,38 @@ jobs:
8689
- macos-latest
8790
- windows-latest
8891
python-version:
89-
- "3.8"
9092
- "3.9"
9193
- "3.10"
9294
- "3.11"
9395
- "3.12"
9496
- "3.13"
97+
- "3.14"
9598
resolution:
9699
- highest
97100
- lowest-direct
98101
exclude: ${{ fromJSON(needs.exclude-test-jobs.outputs.jobs) }}
99102
runs-on: ${{ matrix.os }}
100-
continue-on-error: ${{ matrix.python-version == '3.13' }}
103+
continue-on-error: ${{ matrix.python-version == '3.14' }}
101104

102105
steps:
103106
- name: Checkout
104107
uses: actions/checkout@v4
108+
with:
109+
fetch-depth: 0
110+
fetch-tags: true
105111

106-
- name: Set up Python
112+
- name: Setup Python
107113
uses: actions/setup-python@v5
108114
with:
109115
python-version: ${{ matrix.python-version }}
110116
allow-prereleases: true
111117

112-
- name: Install uv
113-
run: pip install uv
118+
- name: Setup uv
119+
uses: astral-sh/setup-uv@v3
120+
with:
121+
enable-cache: true
122+
cache-dependency-glob: pyproject.toml
123+
cache-suffix: py${{ matrix.python-version }}
114124

115125
- name: Install dependencies
116126
env:

.github/workflows/release.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,34 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
14-
- name: Fetch all tags
15-
run: git fetch --depth=1 --tags
14+
with:
15+
fetch-depth: 0
16+
fetch-tags: true
1617
- name: Setup Python
17-
uses: actions/setup-python@v4
18-
- name: Install build
19-
if: github.repository_owner == 'pawamoy-insiders'
20-
run: python -m pip install build
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
- name: Setup uv
22+
uses: astral-sh/setup-uv@v3
2123
- name: Build dists
2224
if: github.repository_owner == 'pawamoy-insiders'
23-
run: python -m build
25+
run: uv tool run --from build pyproject-build
2426
- name: Upload dists artifact
2527
uses: actions/upload-artifact@v4
2628
if: github.repository_owner == 'pawamoy-insiders'
2729
with:
2830
name: c-insiders
2931
path: ./dist/*
30-
- name: Install git-changelog
31-
if: github.repository_owner != 'pawamoy-insiders'
32-
run: pip install git-changelog
3332
- name: Prepare release notes
3433
if: github.repository_owner != 'pawamoy-insiders'
35-
run: git-changelog --release-notes > release-notes.md
34+
run: uv tool run git-changelog --release-notes > release-notes.md
3635
- name: Create release with assets
37-
uses: softprops/action-gh-release@v1
36+
uses: softprops/action-gh-release@v2
3837
if: github.repository_owner == 'pawamoy-insiders'
3938
with:
4039
files: ./dist/*
4140
- name: Create release
42-
uses: softprops/action-gh-release@v1
41+
uses: softprops/action-gh-release@v2
4342
if: github.repository_owner != 'pawamoy-insiders'
4443
with:
4544
body_path: release-notes.md

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/.pdm-build/
1616
/htmlcov/
1717
/site/
18+
uv.lock
1819

1920
# cache
2021
.cache/

.gitpod.dockerfile

-6
This file was deleted.

.gitpod.yml

-13
This file was deleted.

CONTRIBUTING.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ make setup
2323
> You can install it with:
2424
>
2525
> ```bash
26-
> python3 -m pip install --user pipx
27-
> pipx install uv
26+
> curl -LsSf https://astral.sh/uv/install.sh | sh
2827
> ```
2928
>
3029
> Now you can try running `make setup` again,
31-
> or simply `uv install`.
30+
> or simply `uv sync`.
3231
3332
You now have the dependencies installed.
3433

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# mkdocstrings-c
22

33
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://mkdocstrings.github.io/c/)
4-
[![gitpod](https://img.shields.io/badge/gitpod-workspace-708FCC.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/c)
54
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#c:gitter.im)
65

76
A C handler for mkdocstrings.

config/ruff.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target-version = "py38"
1+
target-version = "py39"
22
line-length = 120
33

44
[lint]

devdeps.txt

-32
This file was deleted.

docs/insiders/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ else:
8888
```
8989
<!-- blacken-docs:on -->
9090

91+
Additionally, your sponsorship will give more weight to your upvotes on issues, helping us prioritize work items in our backlog. For more information on how we prioritize work, see this page: [Backlog management](https://pawamoy.github.io/backlog/).
92+
9193
## How to become a sponsor
9294

9395
Thanks for your interest in sponsoring! In order to become an eligible sponsor

duties.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
from contextlib import contextmanager
88
from importlib.metadata import version as pkgversion
99
from pathlib import Path
10-
from typing import TYPE_CHECKING, Iterator
10+
from typing import TYPE_CHECKING
1111

1212
from duty import duty, tools
1313

1414
if TYPE_CHECKING:
15+
from collections.abc import Iterator
16+
1517
from duty.context import Context
1618

1719

@@ -53,8 +55,8 @@ def changelog(ctx: Context, bump: str = "") -> None:
5355
ctx.run(tools.git_changelog(bump=bump or None), title="Updating changelog")
5456

5557

56-
@duty(pre=["check_quality", "check_types", "check_docs", "check_dependencies", "check-api"])
57-
def check(ctx: Context) -> None: # noqa: ARG001
58+
@duty(pre=["check-quality", "check-types", "check-docs", "check-api"])
59+
def check(ctx: Context) -> None:
5860
"""Check it all!"""
5961

6062

@@ -83,6 +85,7 @@ def check_docs(ctx: Context) -> None:
8385
def check_types(ctx: Context) -> None:
8486
"""Check that the code is correctly typed."""
8587
os.environ["MYPYPATH"] = "src"
88+
os.environ["FORCE_COLOR"] = "1"
8689
ctx.run(
8790
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
8891
title=pyprefix("Type-checking"),
@@ -116,23 +119,33 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
116119

117120

118121
@duty
119-
def docs_deploy(ctx: Context) -> None:
120-
"""Deploy the documentation to GitHub pages."""
122+
def docs_deploy(ctx: Context, *, force: bool = False) -> None:
123+
"""Deploy the documentation to GitHub pages.
124+
125+
Parameters:
126+
force: Whether to force deployment, even from non-Insiders version.
127+
"""
121128
os.environ["DEPLOY"] = "true"
122129
with material_insiders() as insiders:
123130
if not insiders:
124131
ctx.run(lambda: False, title="Not deploying docs without Material for MkDocs Insiders!")
125-
origin = ctx.run("git config --get remote.origin.url", silent=True)
132+
origin = ctx.run("git config --get remote.origin.url", silent=True, allow_overrides=False)
126133
if "pawamoy-insiders/mkdocstrings-c" in origin:
127134
ctx.run(
128135
"git remote add upstream git@github.com:mkdocstrings/c",
129136
silent=True,
130137
nofail=True,
138+
allow_overrides=False,
131139
)
132140
ctx.run(
133141
tools.mkdocs.gh_deploy(remote_name="upstream", force=True),
134142
title="Deploying documentation",
135143
)
144+
elif force:
145+
ctx.run(
146+
tools.mkdocs.gh_deploy(force=True),
147+
title="Deploying documentation",
148+
)
136149
else:
137150
ctx.run(
138151
lambda: False,

mkdocs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ plugins:
142142
show_symbol_type_toc: true
143143
signature_crossrefs: true
144144
summary: true
145-
- git-committers:
145+
- git-revision-date-localized:
146146
enabled: !ENV [DEPLOY, false]
147-
repository: mkdocstrings/c
147+
enable_creation_date: true
148+
type: timeago
148149
- minify:
149150
minify_html: !ENV [DEPLOY, false]
150151
- group:

0 commit comments

Comments
 (0)