Skip to content

Commit 5e1b854

Browse files
committed
chore: Template upgrade
1 parent ae42356 commit 5e1b854

File tree

8 files changed

+66
-46
lines changed

8 files changed

+66
-46
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.23
2+
_commit: 0.16.2
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
pull_request:
66
branches:
7-
- main
7+
- main
88

99
defaults:
1010
run:

.github/workflows/dists.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 build
19+
if: github.repository_owner == 'pawamoy-insiders'
20+
run: python -m pip install build
21+
- name: Build dists
22+
if: github.repository_owner == 'pawamoy-insiders'
23+
run: python -m build
24+
- name: Upload dists artifact
25+
uses: actions/upload-artifact@v3
26+
if: github.repository_owner == 'pawamoy-insiders'
27+
with:
28+
name: python-insiders
29+
path: ./dist/*
30+
- name: Install git-changelog
31+
if: github.repository_owner != 'pawamoy-insiders'
32+
run: pip install git-changelog
33+
- name: Prepare release notes
34+
if: github.repository_owner != 'pawamoy-insiders'
35+
run: git-changelog --release-notes > release-notes.md
36+
- name: Create release with assets
37+
uses: softprops/action-gh-release@v1
38+
if: github.repository_owner == 'pawamoy-insiders'
39+
with:
40+
files: ./dist/*
41+
- name: Create release
42+
uses: softprops/action-gh-release@v1
43+
if: github.repository_owner != 'pawamoy-insiders'
44+
with:
45+
body_path: release-notes.md

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: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def check_quality(ctx: Context) -> None:
109109
ctx.run(
110110
ruff.check(*PY_SRC_LIST, config="config/ruff.toml"),
111111
title=pyprefix("Checking code quality"),
112+
command=f"ruff check --config config/ruff.toml {PY_SRC}",
112113
)
113114

114115

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

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

131136

132137
@duty
@@ -138,7 +143,12 @@ def check_docs(ctx: Context) -> None:
138143
"""
139144
Path("htmlcov").mkdir(parents=True, exist_ok=True)
140145
Path("htmlcov/index.html").touch(exist_ok=True)
141-
ctx.run(mkdocs.build(strict=True, config_file=mkdocs_config()), title=pyprefix("Building documentation"))
146+
config = mkdocs_config()
147+
ctx.run(
148+
mkdocs.build(strict=True, config_file=config, verbose=True),
149+
title=pyprefix("Building documentation"),
150+
command=f"mkdocs build -vsf {config}",
151+
)
142152

143153

144154
@duty
@@ -152,6 +162,7 @@ def check_types(ctx: Context) -> None:
152162
ctx.run(
153163
mypy.run(*PY_SRC_LIST, config_file="config/mypy.ini"),
154164
title=pyprefix("Type-checking"),
165+
command=f"mypy --config-file config/mypy.ini {PY_SRC}",
155166
)
156167

157168

@@ -166,8 +177,9 @@ def check_api(ctx: Context) -> None:
166177

167178
griffe_check = lazy(g_check, name="griffe.check")
168179
ctx.run(
169-
griffe_check("mkdocstrings_handlers", search_paths=["src"]),
180+
griffe_check("mkdocstrings_handlers", search_paths=["src"], color=True),
170181
title="Checking for API breaking changes",
182+
command="griffe check -ssrc mkdocstrings_handlers",
171183
nofail=True,
172184
)
173185

@@ -301,4 +313,5 @@ def test(ctx: Context, match: str = "") -> None:
301313
ctx.run(
302314
pytest.run("-n", "auto", "tests", config_file="config/pytest.ini", select=match, color="yes"),
303315
title=pyprefix("Running tests"),
316+
command=f"pytest -c config/pytest.ini -n auto -k{match!r} --color=yes tests",
304317
)

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "A Python handler for mkdocstrings."
88
authors = [{name = "Timothée Mazzucotelli", email = "pawamoy@pm.me"}]
99
license = {text = "ISC"}
1010
readme = "README.md"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
keywords = []
1313
dynamic = ["version"]
1414
classifiers = [
@@ -17,7 +17,6 @@ classifiers = [
1717
"Programming Language :: Python",
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3 :: Only",
20-
"Programming Language :: Python :: 3.7",
2120
"Programming Language :: Python :: 3.8",
2221
"Programming Language :: Python :: 3.9",
2322
"Programming Language :: Python :: 3.10",

src/mkdocstrings_handlers/python/handler.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from griffe.collections import LinesCollection, ModulesCollection
1616
from griffe.docstrings.parsers import Parser
1717
from griffe.exceptions import AliasResolutionError
18+
from griffe.extensions import load_extensions
1819
from griffe.loader import GriffeLoader
1920
from griffe.logger import patch_loggers
2021
from mkdocstrings.extension import PluginError
@@ -24,12 +25,6 @@
2425

2526
from mkdocstrings_handlers.python import rendering
2627

27-
try:
28-
from griffe.extensions import load_extensions
29-
except ImportError:
30-
# TODO: remove once support for Griffe 0.25 is dropped
31-
from griffe.agents.extensions import load_extensions # type: ignore[no-redef]
32-
3328
if TYPE_CHECKING:
3429
from markdown import Markdown
3530

0 commit comments

Comments
 (0)