Skip to content

Commit 7c686af

Browse files
Prepare for v1.2.0 (#79)
1 parent 04b3132 commit 7c686af

File tree

21 files changed

+100
-109
lines changed

21 files changed

+100
-109
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
29+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3030

3131
steps:
3232
- uses: actions/checkout@v1
@@ -43,14 +43,14 @@ jobs:
4343
cd dart-sass && chmod +x ./sass
4444
./sass --no-source-map ../all.scss ../dist/neoteroi-mkdocs.css
4545
./sass --no-source-map --style compressed ../all.scss ../dist/neoteroi-mkdocs.min.css
46-
if: matrix.python-version == '3.10'
46+
if: matrix.python-version == '3.13'
4747

4848
- name: Publish CSS files
4949
uses: actions/upload-artifact@v4
5050
with:
5151
name: arts-package-css
5252
path: styles/dist
53-
if: matrix.python-version == '3.10'
53+
if: matrix.python-version == '3.13'
5454

5555
- name: Use Python ${{ matrix.python-version }}
5656
uses: actions/setup-python@v4
@@ -80,24 +80,20 @@ jobs:
8080
path: junit/pytest-results-${{ matrix.python-version }}.xml
8181
if: always()
8282

83-
- name: Codecov
84-
run: |
85-
bash <(curl -s https://codecov.io/bash)
86-
8783
- name: Install distribution dependencies
8884
run: pip install build
89-
if: matrix.python-version == '3.12'
85+
if: matrix.python-version == '3.13'
9086

9187
- name: Create distribution package
9288
run: python -m build
93-
if: matrix.python-version == '3.12'
89+
if: matrix.python-version == '3.13'
9490

9591
- name: Upload distribution package
9692
uses: actions/upload-artifact@v4
9793
with:
9894
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
9995
path: dist
100-
if: matrix.python-version == '3.12'
96+
if: matrix.python-version == '3.13'
10197

10298
publish:
10399
runs-on: ubuntu-latest
@@ -111,10 +107,10 @@ jobs:
111107
merge-multiple: true
112108
path: dist
113109

114-
- name: Use Python 3.12
110+
- name: Use Python 3.13
115111
uses: actions/setup-python@v1
116112
with:
117-
python-version: '3.12'
113+
python-version: '3.13'
118114

119115
- name: Install dependencies
120116
run: |

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.0] 2025-11-23
9+
10+
- Add support for custom templates, by @sindrehan.
11+
- Remove support for Python 3.9.
12+
- Add Python 3.14 to the build matrix.
13+
- Remove Codecov from build and README.
14+
- Update type annotations to Python >= 3.10.
15+
816
## [1.1.3] 2025-08-02
917

1018
- Improve `read_from_source()` to support an optional CWD parameter used to

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
[![pypi](https://img.shields.io/pypi/v/neoteroi-mkdocs.svg)](https://pypi.python.org/pypi/neoteroi-mkdocs)
33
[![versions](https://img.shields.io/pypi/pyversions/neoteroi-mkdocs.svg)](https://github.com/neoteroi/mkdocs-plugins)
44
[![license](https://img.shields.io/github/license/neoteroi/mkdocs-plugins.svg)](https://github.com/neoteroi/mkdocs-plugins/blob/main/LICENSE)
5-
[![codecov](https://codecov.io/gh/Neoteroi/mkdocs-plugins/branch/main/graph/badge.svg)](https://codecov.io/gh/Neoteroi/mkdocs-plugins)
65
[![documentation](https://img.shields.io/badge/📖-docs-purple)](https://www.neoteroi.dev/mkdocs-plugins/)
76

87

neoteroi/mkdocs/cards/domain.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
from dataclasses import dataclass
2-
from typing import List, Optional
32

43
from neoteroi.mkdocs.markdown.images import Image
54

65

76
@dataclass
87
class CardItem:
98
title: str
10-
url: Optional[str] = None
11-
content: Optional[str] = None
12-
icon: Optional[str] = None
13-
key: Optional[str] = None
14-
image: Optional[Image] = None
9+
url: str | None = None
10+
content: str | None = None
11+
icon: str | None = None
12+
key: str | None = None
13+
image: Image | None = None
1514

1615
def __post_init__(self):
1716
if self.image and not self.image.alt:
@@ -20,4 +19,4 @@ def __post_init__(self):
2019

2120
@dataclass
2221
class Cards:
23-
items: List[CardItem]
22+
items: list[CardItem]

neoteroi/mkdocs/contribs/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from fnmatch import fnmatch
1414
from pathlib import Path
1515
from subprocess import CalledProcessError
16-
from typing import List
1716

1817
from mkdocs.config import config_options as c
1918
from mkdocs.plugins import BasePlugin
@@ -38,7 +37,7 @@ def __init__(self) -> None:
3837
self._git_reader = GitContributionsReader()
3938
self._txt_reader = TXTContributionsReader()
4039

41-
def get_contributors(self, file_path: Path) -> List[Contributor]:
40+
def get_contributors(self, file_path: Path) -> list[Contributor]:
4241
git_history_contributors = self._git_reader.get_contributors(file_path)
4342
configured_contributors = self._txt_reader.get_contributors(file_path)
4443
return list(
@@ -71,7 +70,7 @@ def __init__(self) -> None:
7170

7271
def _merge_contributor_by_email(
7372
self,
74-
contributors: List[Contributor],
73+
contributors: list[Contributor],
7574
contributor: Contributor,
7675
contributor_info: dict,
7776
) -> bool:
@@ -97,7 +96,7 @@ def _merge_contributor_by_email(
9796

9897
return False
9998

100-
def _get_contributors(self, page_file: File) -> List[Contributor]:
99+
def _get_contributors(self, page_file: File) -> list[Contributor]:
101100
results = []
102101
contributors = self._contribs_reader.get_contributors(
103102
Path("docs") / page_file.src_path

neoteroi/mkdocs/contribs/domain.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
from dataclasses import dataclass
33
from datetime import datetime
44
from pathlib import Path
5-
from typing import List, Optional
65

76

87
@dataclass
98
class Contributor:
109
name: str
1110
email: str
1211
count: int = -1
13-
image: Optional[str] = None
14-
key: Optional[str] = None
12+
image: str | None = None
13+
key: str | None = None
1514

1615

1716
class ContributionsReader(ABC):
1817
@abstractmethod
19-
def get_contributors(self, file_path: Path) -> List[Contributor]:
18+
def get_contributors(self, file_path: Path) -> list[Contributor]:
2019
"""Obtains the list of contributors for a file with the given path."""
2120

2221
@abstractmethod

neoteroi/mkdocs/contribs/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import subprocess
1010
from datetime import datetime
1111
from pathlib import Path
12-
from typing import Iterable, List, Tuple
12+
from typing import Iterable
1313

1414
from dateutil.parser import ParserError
1515
from dateutil.parser import parse as parse_date
@@ -26,7 +26,7 @@ def _decode(self, value: bytes) -> str:
2626
except UnicodeDecodeError:
2727
return value.decode("ISO-8859-1")
2828

29-
def _parse_name_and_email(self, name_and_email) -> Tuple[str, str]:
29+
def _parse_name_and_email(self, name_and_email) -> tuple[str, str]:
3030
match = self._name_email_rx.search(name_and_email)
3131
if match:
3232
name = match.groupdict()["name"].strip()
@@ -41,7 +41,7 @@ def parse_committers(self, output: str) -> Iterable[Contributor]:
4141
name, email = self._parse_name_and_email(name_and_email)
4242
yield Contributor(name, email, int(count))
4343

44-
def get_contributors(self, file_path: Path) -> List[Contributor]:
44+
def get_contributors(self, file_path: Path) -> list[Contributor]:
4545
"""
4646
Obtains the list of contributors for a file with the given path,
4747
using the Git CLI.

neoteroi/mkdocs/contribs/html.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import xml.etree.ElementTree as etree
66
from dataclasses import dataclass
77
from datetime import datetime
8-
from typing import List
98
from xml.etree.ElementTree import tostring as xml_to_str
109

1110
from neoteroi.mkdocs.contribs.domain import Contributor
@@ -25,7 +24,7 @@ class ContribsViewOptions:
2524

2625

2726
def contribution_stats_to_element(
28-
contributors: List[Contributor],
27+
contributors: list[Contributor],
2928
last_commit_date: datetime,
3029
options: ContribsViewOptions,
3130
) -> etree.Element:
@@ -85,7 +84,7 @@ def contribution_stats_to_element(
8584

8685

8786
def render_contribution_stats(
88-
contributors: List[Contributor],
87+
contributors: list[Contributor],
8988
last_commit_date: datetime,
9089
options: ContribsViewOptions,
9190
) -> str:

neoteroi/mkdocs/contribs/txt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
from datetime import datetime
44
from pathlib import Path
5-
from typing import Iterable, List, Tuple
5+
from typing import Iterable
66

77
from dateutil.parser import parse
88

@@ -30,7 +30,7 @@ class TXTContributionsReader(ContributionsReader):
3030
r"^\s*Last\smodified\stime:\s(?P<value>.+)$", re.IGNORECASE | re.MULTILINE
3131
)
3232

33-
def _parse_value(self, value: str) -> Tuple[str, str, int]:
33+
def _parse_value(self, value: str) -> tuple[str, str, int]:
3434
match = self._contrib_rx.search(value)
3535
if match:
3636
values = match.groupdict()
@@ -51,7 +51,7 @@ def _get_contributors_from_txt_file(self, file_path: Path) -> Iterable[Contribut
5151
if name and email:
5252
yield Contributor(name, email, count)
5353

54-
def get_contributors(self, file_path: Path) -> List[Contributor]:
54+
def get_contributors(self, file_path: Path) -> list[Contributor]:
5555
"""
5656
Obtains the list of contributors from a txt file with the given path.
5757
The file contents should look like:

neoteroi/mkdocs/markdown/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import re
7-
from typing import Dict, Tuple
87

98
_PROPS_RE = re.compile(
109
r"""\s?((?P<name>[^\s\=]+)=(?P<quot>"|')(?P<value>[^\"\']+)(?P=quot))""",
@@ -14,7 +13,7 @@
1413

1514
def parse_props(
1615
line: str, prefix: str = "", bool_attrs: bool = False
17-
) -> Dict[str, str]:
16+
) -> dict[str, str]:
1817
"""
1918
Parses a line describing properties, in this form:
2019
@@ -49,7 +48,7 @@ def parse_props(
4948
return props
5049

5150

52-
def extract_props(line: str, prefix: str = "") -> Tuple[str, Dict[str, str]]:
51+
def extract_props(line: str, prefix: str = "") -> tuple[str, dict[str, str]]:
5352
"""
5453
Extracts properties like the `parse_props` function, but
5554
also returns the original line with properties removed.

0 commit comments

Comments
 (0)