Skip to content

Commit

Permalink
Add Python 3.12 to the build matrix
Browse files Browse the repository at this point in the history
* Add Python 3.12 to the build matrix
* Add support for running tests with Python 3.12
  • Loading branch information
RobertoPrevato authored Dec 24, 2023
1 parent 276e671 commit c5188ac
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ per-file-ignores =
tests/test_timeline.py:E501
tests/test_cards.py:E501
tests/test_gantt.py:E501
exclude =
venv
dist
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v1
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2023-12-24

- Adds support for running tests using Python 3.12, and adds Python 3.12 to the
build matrix. Note: only tests code did not support Python 3.12 because it
used `pkg_resources`.

## [1.0.4] - 2023-07-28 :parasol_on_ground:

- Unpins the dependencies on `mkdocs` and `httpx`, to fix
Expand Down
6 changes: 5 additions & 1 deletion mkdocs-plugins.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"settings": {
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/ra/projects/github/mkdocs-oad-plugin/.github/workflows/build.yml"
}
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
},
"launch": {
"version": "0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion neoteroi/mkdocs/projects/gantt/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def build_event(self, parent, event: Event):
{
"class": "nt-timeline-dot bigger",
"title": f"{event.title} {self._format_time(event.time)}",
"style": f"left: {self._calc_time_left(event.time)-4}px;"
"style": f"left: {self._calc_time_left(event.time) - 4}px;"
if event.time
else "",
},
Expand Down
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "neoteroi-mkdocs"
dynamic = ["version"]
authors = [
{ name = "Roberto Prevato", email = "[email protected]" },
]
authors = [{ name = "Roberto Prevato", email = "[email protected]" }]
description = "Plugins for MkDocs and Python Markdown"
readme = "README.md"
requires-python = ">=3.7"
Expand All @@ -20,9 +18,18 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
]
keywords = ["MkDocs", "OpenAPI", "Swagger", "Markdown", "plugins", "extensions", "documentation"]
keywords = [
"MkDocs",
"OpenAPI",
"Swagger",
"Markdown",
"plugins",
"extensions",
"documentation",
]
dependencies = [
"essentials-openapi",
"mkdocs",
Expand Down
17 changes: 12 additions & 5 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import os
import pprint

import pkg_resources
try:
from importlib.resources import files

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

def get_resource_file_path(file_name: str) -> str:
return os.path.abspath(
pkg_resources.resource_filename(__name__, os.path.join(".", "res", file_name))
)
except ImportError:
# Python 3.8
import pkg_resources

def get_resource_file_path(file_name: str) -> str:
return pkg_resources.resource_filename(
__name__, os.path.join(".", "res", file_name)
)


def get_resource_file_contents(file_name: str) -> str:
Expand Down
Empty file added tests/res/__init__.py
Empty file.

0 comments on commit c5188ac

Please sign in to comment.