Skip to content

Commit 3968972

Browse files
authored
Add support for python 3.13 (#18)
* Add support for python 3.13 * Drop support for python 3.8
1 parent 05d8736 commit 3968972

File tree

14 files changed

+51
-172
lines changed

14 files changed

+51
-172
lines changed

.github/workflows/python-code-style.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
22+
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2323
os: [ubuntu-latest]
2424
runs-on: ${{ matrix.os }}
2525
steps:

.github/workflows/python-typing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.13
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.12"
23+
python-version: "3.13"
2424

2525
- name: Install dependencies
2626
run: |

.github/workflows/reusable-github-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
- name: Checkout
4040
uses: actions/checkout@v4
4141

42-
- name: Set up Python 3.12
42+
- name: Set up Python 3.13
4343
uses: actions/setup-python@v5
4444
with:
45-
python-version: "3.12"
45+
python-version: "3.13"
4646

4747
# Here we want to install the current package in editable mode,
4848
# in case mkdocs needs the package (i.e. we are building a mkdocs plugin).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# mkdocs-macros-adr-summary
2-
![Static Badge](https://img.shields.io/badge/Python-3.8_%7C_3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)
2+
![Static Badge](https://img.shields.io/badge/Python-3.9_%7C_3.10_%7C_3.11_%7C_3.12_%7C_3.13-blue?logo=python&logoColor=white)
33
[![Stable Version](https://img.shields.io/pypi/v/mkdocs-macros-adr-summary?color=blue)](https://pypi.org/project/mkdocs-macros-adr-summary/)
44
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
55

docs/index.md

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1 @@
1-
# mkdocs-macros-adr-summary
2-
3-
![Static Badge](https://img.shields.io/badge/Python-3.8_%7C_3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)
4-
[![Stable Version](https://img.shields.io/pypi/v/mkdocs-macros-adr-summary?color=blue)](https://pypi.org/project/mkdocs-macros-adr-summary/)
5-
[![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#beta)
6-
7-
[![Python tests](https://github.com/febus982/mkdocs-macros-adr-summary/actions/workflows/python-tests.yml/badge.svg?branch=main)](https://github.com/febus982/mkdocs-macros-adr-summary/actions/workflows/python-tests.yml)
8-
[![Maintainability](https://api.codeclimate.com/v1/badges/5631f62f6dcd3a34d7ae/maintainability)](https://codeclimate.com/github/febus982/mkdocs-macros-adr-summary/maintainability)
9-
[![Test Coverage](https://api.codeclimate.com/v1/badges/5631f62f6dcd3a34d7ae/test_coverage)](https://codeclimate.com/github/febus982/mkdocs-macros-adr-summary/test_coverage)
10-
11-
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
12-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
13-
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
14-
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
15-
16-
This is a macro plugin to generates summaries from a list of a ADR documents in a directory.
17-
18-
The single ADR documents file names have to respect this format: `0000-my-decision-title.md`
19-
20-
* start with 4 digits followed by the character `-`
21-
* the rest of the file name can contain only letters, numbers, dashes and underscores (`[A-Za-z0-9_-]` regex)
22-
* end with the `.md` extension
23-
24-
Examples and documentation can be found [here](https://febus982.github.io/mkdocs-macros-adr-summary)
25-
26-
The package should be stable enough for daily use. I'll release 1.0.0, and switch to semantic version,
27-
as soon as support for MADR version 2 has been implemented. Until that breaking changes can be introduced
28-
and will be documented in the GitHub release description.
29-
30-
## Quick start
31-
32-
Enable the plugin in `mkdocs.yml`
33-
34-
```yaml
35-
plugins:
36-
- macros:
37-
modules:
38-
- mkdocs_macros_adr_summary
39-
```
40-
41-
Create a markdown page in your mkdocs website and use the `adr_summary` macro providing
42-
the path containing your ADR files relative to the `mkdocs.yml` file.
43-
44-
```
45-
{% raw %}
46-
{{ adr_summary(adr_path="docs/adr", adr_style="nygard") }}
47-
{% endraw %}
48-
```
49-
50-
`adr_style` can be `nygard` or `MADR3`
51-
52-
## More customization
53-
54-
The page output is generated using a jinja template, but you can provide a custom one. The file path
55-
must still be relative to the `mkdocs.yml` file.
56-
57-
```
58-
{% raw %}
59-
{{ adr_summary(adr_path="docs/adr", adr_style="MADR3", template_file="other.jinja") }}
60-
{% endraw %}
61-
```
62-
63-
The default template is:
64-
65-
```
66-
{% raw %}
67-
| ID | Date | Decision | Status |
68-
|----|------|----------|--------|
69-
{% for d in documents %}| {{ d.document_id }} | {{ d.date.strftime('%d-%m-%Y') if d.date else "-"}} | [{{ d.title }}]({{ d.file_path }}) | {{ d.status }} |
70-
{% endfor %}
71-
{% endraw %}
72-
```
73-
74-
The `documents` variable in the jinja template is a Sequence of `ADRDocument` models:
75-
76-
```python
77-
@dataclass
78-
class ADRDocument:
79-
file_path: str
80-
document_id: Optional[int] = None
81-
title: Optional[str] = None
82-
date: Optional[date] = None
83-
status: Optional[str] = None
84-
statuses: Sequence[str] = tuple()
85-
deciders: Optional[str] = None
86-
consulted: Optional[str] = None
87-
informed: Optional[str] = None
88-
```
89-
90-
There are some differences in what metadata is available when using different formats:
91-
92-
| | Nygard | MADR3 | MADR2 |
93-
|-----------|--------|-------|-------|
94-
| file_path | ✅︎ | ✅︎ | ✅︎ |
95-
| title | ✅︎ | ✅︎ | ✅︎ |
96-
| date | ✅︎ | ✅︎ | ✅︎ |
97-
| status || ✅︎ | ✅︎ |
98-
| statuses | ✅︎ |||
99-
| deciders || ✅︎ | ✅︎ |
100-
| consulted || ✅︎ ||
101-
| informed || ✅︎ ||
102-
103-
* **Nygard format**
104-
* `status` is the last item `statuses`. (I don't believe we should use multiple
105-
statuses, however `adr-tools` allows it)
106-
* `deciders`, `consulted` and `informed` are not supported by the format
107-
* **MADR2** and **MADR3**
108-
* I wasn't able to find an automated tool supporting superseding documents.
109-
By looking at the template it looks like there's a single status.
110-
`statuses` will return a list with a single status.
111-
112-
## Supported ADR formats
113-
114-
The supported ADR formats are:
115-
* `nygard` format, it is recommended to use [adr-tools](https://github.com/npryce/adr-tools) to manage the directory
116-
* `MADR` [version 3](https://github.com/adr/madr/blob/3.0.0/template/adr-template.md)
117-
* `MADR` [version 2](https://github.com/adr/madr/blob/2.1.2/template/template.md)
118-
119-
## Commands for development
120-
121-
All the common commands used during development can be run using make targets:
122-
123-
* `make dev-dependencies`: Install dev requirements
124-
* `make update-dependencies`: Update dev requirements
125-
* `make test`: Run test suite
126-
* `make check`: Run tests, code style and lint checks
127-
* `make fix`: Run code style and lint automatic fixes (where possible)
128-
* `make docs`: Render the mkdocs website locally
1+
--8<-- "./README.md"

mkdocs_macros_adr_summary/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ def define_env(env: MacrosPlugin) -> None:
3030
env.macro(partial(adr_summary, env), "adr_summary")
3131

3232

33-
__version__ = "0.0.0"
34-
__version_tuple__ = (0, 0, 0)
33+
__version__ = "1.0.0.post2.dev0+05d8736"
34+
__version_tuple__ = (1, 0, 0, "post2", "dev0", "05d8736")

0 commit comments

Comments
 (0)