Skip to content

Commit 47b4115

Browse files
committed
chore: Template upgrade
1 parent 8cfc7e9 commit 47b4115

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
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.16.5
2+
_commit: 0.16.9
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: pawamoy@pm.me
55
author_fullname: Timothée Mazzucotelli

docs/css/mkdocstrings.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ a.external::after,
99
a.autorefs-external::after {
1010
/* https://primer.style/octicons/arrow-up-right-24 */
1111
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
12+
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
1213
content: ' ';
1314

1415
display: inline-block;

duties.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@
44

55
import os
66
import sys
7+
from importlib.metadata import version as pkgversion
78
from pathlib import Path
89
from typing import TYPE_CHECKING, Any
910

1011
from duty import duty
1112
from duty.callables import black, blacken_docs, coverage, lazy, mkdocs, mypy, pytest, ruff, safety
1213

13-
if sys.version_info < (3, 8):
14-
from importlib_metadata import version as pkgversion
15-
else:
16-
from importlib.metadata import version as pkgversion
17-
18-
1914
if TYPE_CHECKING:
2015
from duty.context import Context
2116

17+
2218
PY_SRC_PATHS = (Path(_) for _ in ("src", "tests", "duties.py", "scripts"))
2319
PY_SRC_LIST = tuple(str(_) for _ in PY_SRC_PATHS)
2420
PY_SRC = " ".join(PY_SRC_LIST)

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ plugins:
148148
docstring_options:
149149
ignore_init_summary: true
150150
docstring_section_style: list
151+
filters: ["!^_"]
151152
heading_level: 1
152153
inherited_members: true
153154
merge_init_into_class: true
@@ -159,6 +160,7 @@ plugins:
159160
show_symbol_type_heading: true
160161
show_symbol_type_toc: true
161162
signature_crossrefs: true
163+
summary: true
162164
- git-committers:
163165
enabled: !ENV [DEPLOY, false]
164166
repository: mkdocstrings/python

scripts/insiders.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ class Feature:
3939
"""Class representing an Insiders feature."""
4040

4141
name: str
42-
ref: str
42+
ref: str | None
4343
since: date | None
4444
project: Project | None
4545

46-
def url(self, rel_base: str = "..") -> str: # noqa: D102
46+
def url(self, rel_base: str = "..") -> str | None: # noqa: D102
47+
if not self.ref:
48+
return None
4749
if self.project:
4850
rel_base = self.project.url
4951
return posixpath.join(rel_base, self.ref.lstrip("/"))
@@ -56,7 +58,8 @@ def render(self, rel_base: str = "..", *, badge: bool = False) -> None: # noqa:
5658
ft_date = self.since.strftime("%B %d, %Y") # type: ignore[union-attr]
5759
new = f' :material-alert-decagram:{{ .new-feature .vibrate title="Added on {ft_date}" }}'
5860
project = f"[{self.project.name}]({self.project.url}) — " if self.project else ""
59-
print(f"- [{'x' if self.since else ' '}] {project}[{self.name}]({self.url(rel_base)}){new}")
61+
feature = f"[{self.name}]({self.url(rel_base)})" if self.ref else self.name
62+
print(f"- [{'x' if self.since else ' '}] {project}{feature}{new}")
6063

6164

6265
@dataclass
@@ -99,7 +102,7 @@ def load_goals(data: str, funding: int = 0, project: Project | None = None) -> d
99102
features=[
100103
Feature(
101104
name=feature_data["name"],
102-
ref=feature_data["ref"],
105+
ref=feature_data.get("ref"),
103106
since=feature_data.get("since")
104107
and datetime.strptime(feature_data["since"], "%Y/%m/%d").date(), # noqa: DTZ007
105108
project=project,

0 commit comments

Comments
 (0)