Skip to content

Commit c5188ac

Browse files
Add Python 3.12 to the build matrix
* Add Python 3.12 to the build matrix * Add support for running tests with Python 3.12
1 parent 276e671 commit c5188ac

8 files changed

Lines changed: 39 additions & 12 deletions

File tree

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ per-file-ignores =
88
tests/test_timeline.py:E501
99
tests/test_cards.py:E501
1010
tests/test_gantt.py:E501
11+
exclude =
12+
venv
13+
dist

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
python-version: [3.8, 3.9, "3.10", "3.11"]
23+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
2424

2525
steps:
2626
- uses: actions/checkout@v1

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ 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+
## 2023-12-24
9+
10+
- Adds support for running tests using Python 3.12, and adds Python 3.12 to the
11+
build matrix. Note: only tests code did not support Python 3.12 because it
12+
used `pkg_resources`.
13+
814
## [1.0.4] - 2023-07-28 :parasol_on_ground:
915

1016
- Unpins the dependencies on `mkdocs` and `httpx`, to fix

mkdocs-plugins.code-workspace

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"settings": {
88
"yaml.schemas": {
99
"https://json.schemastore.org/github-workflow.json": "file:///home/ra/projects/github/mkdocs-oad-plugin/.github/workflows/build.yml"
10-
}
10+
},
11+
"[python]": {
12+
"editor.defaultFormatter": "ms-python.black-formatter"
13+
},
14+
"python.formatting.provider": "none"
1115
},
1216
"launch": {
1317
"version": "0.2.0",

neoteroi/mkdocs/projects/gantt/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def build_event(self, parent, event: Event):
410410
{
411411
"class": "nt-timeline-dot bigger",
412412
"title": f"{event.title} {self._format_time(event.time)}",
413-
"style": f"left: {self._calc_time_left(event.time)-4}px;"
413+
"style": f"left: {self._calc_time_left(event.time) - 4}px;"
414414
if event.time
415415
else "",
416416
},

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "neoteroi-mkdocs"
77
dynamic = ["version"]
8-
authors = [
9-
{ name = "Roberto Prevato", email = "roberto.prevato@gmail.com" },
10-
]
8+
authors = [{ name = "Roberto Prevato", email = "roberto.prevato@gmail.com" }]
119
description = "Plugins for MkDocs and Python Markdown"
1210
readme = "README.md"
1311
requires-python = ">=3.7"
@@ -20,9 +18,18 @@ classifiers = [
2018
"Programming Language :: Python :: 3.9",
2119
"Programming Language :: Python :: 3.10",
2220
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
2322
"Operating System :: OS Independent",
2423
]
25-
keywords = ["MkDocs", "OpenAPI", "Swagger", "Markdown", "plugins", "extensions", "documentation"]
24+
keywords = [
25+
"MkDocs",
26+
"OpenAPI",
27+
"Swagger",
28+
"Markdown",
29+
"plugins",
30+
"extensions",
31+
"documentation",
32+
]
2633
dependencies = [
2734
"essentials-openapi",
2835
"mkdocs",

tests/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import os
22
import pprint
33

4-
import pkg_resources
4+
try:
5+
from importlib.resources import files
56

7+
def get_resource_file_path(file_name: str) -> str:
8+
return str(files("tests.res") / file_name)
69

7-
def get_resource_file_path(file_name: str) -> str:
8-
return os.path.abspath(
9-
pkg_resources.resource_filename(__name__, os.path.join(".", "res", file_name))
10-
)
10+
except ImportError:
11+
# Python 3.8
12+
import pkg_resources
13+
14+
def get_resource_file_path(file_name: str) -> str:
15+
return pkg_resources.resource_filename(
16+
__name__, os.path.join(".", "res", file_name)
17+
)
1118

1219

1320
def get_resource_file_contents(file_name: str) -> str:

tests/res/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)