Skip to content

Commit 3608902

Browse files
authored
Add support for python 3.12 (#56)
Closes #55
1 parent 11580f0 commit 3608902

File tree

5 files changed

+38
-18
lines changed

5 files changed

+38
-18
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,24 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
ci:
10+
ci-pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.11"
19+
- name: Install project
20+
run: pip install -e .[dev,test]
21+
- name: run pre-commit
22+
run: "pre-commit run --all"
23+
ci-test:
1124
strategy:
1225
fail-fast: false
1326
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11"]
27+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12.0-rc.1"]
1528
sphinx-version: ["6.*", "7.*"]
1629
runs-on: ubuntu-latest
1730
steps:
@@ -22,11 +35,9 @@ jobs:
2235
with:
2336
python-version: ${{ matrix.python-version }}
2437
- name: Install project
25-
run: pip install -e .[dev]
38+
run: pip install -e .[test]
2639
- name: Install sphinx
2740
run: pip install sphinx==${{ matrix.sphinx-version }}
28-
- name: run pre-commit
29-
run: "pre-commit run --all"
3041
- name: run tests (with coverage)
3142
run: "pytest --cov swagger_plugin_for_sphinx --cov-report html --cov-report xml tests/"
3243
- name: run diff-cover

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
python-version: "3.11"
2121
- name: Install project
22-
run: pip install -e .[dev]
22+
run: pip install -e .
2323
- name: Install libraries
2424
run: pip install -U build twine
2525
- name: Create wheel

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 3.3.0
4+
5+
* Support python 3.12
6+
37
## 3.2.0
48

59
* Support for inline swagger pages

pyproject.toml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "swagger-plugin-for-sphinx"
7-
version = "3.2.0"
7+
version = "3.3.0"
88
description = "Sphinx plugin which renders a OpenAPI specification with Swagger"
99
authors = [{ name = "Kai Mueller", email = "[email protected]"}]
1010
readme = "README.md"
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.9",
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
2627
"Topic :: Documentation",
2728
"Topic :: Documentation :: Sphinx",
2829
"Typing :: Typed"
@@ -43,19 +44,21 @@ text = "Apache-2.0"
4344

4445
[project.optional-dependencies]
4546
dev = [
46-
"pre-commit==3.3.2",
47-
"pylint==2.17.4",
48-
"pytest==7.3.1",
49-
"pytest-mock==3.10.0",
50-
"coverage==7.2.0",
51-
"diff-cover==7.5.0",
52-
"pytest-cov==4.1.0",
53-
"black==23.3.0",
47+
"pre-commit==3.3.3",
48+
"pylint==2.17.5",
49+
"black==23.7.0",
5450
"isort==5.12.0",
55-
"flake8==6.0.0",
56-
"mypy==1.3.0",
51+
"flake8==6.1.0",
52+
"mypy==1.5.0",
5753
"types-docutils==0.20.0.1"
5854
]
55+
test = [
56+
"pytest==7.4.0",
57+
"pytest-mock==3.11.1",
58+
"coverage==7.2.7",
59+
"diff-cover==7.7.0",
60+
"pytest-cov==4.1.0",
61+
]
5962

6063
[tool.setuptools.packages.find]
6164
include = ["swagger_plugin_for_sphinx"]
@@ -74,6 +77,7 @@ warn_incomplete_stub = true
7477
warn_no_return = true
7578
warn_unreachable = true
7679
strict = true
80+
python_version = "3.8"
7781
# output
7882
pretty = true
7983
show_column_numbers = true
@@ -88,6 +92,7 @@ min-public-methods = 0
8892

8993
[tool.pylint.master]
9094
max-line-length = 100
95+
py-version = [3, 8]
9196

9297
[tool.pylint."messages control"]
9398
enable = ["all"]

tests/test_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_inline(sphinx_runner: SphinxRunner, tmp_path: Path) -> None:
135135
with open(build / "api.html", encoding="utf-8") as file:
136136
html = file.read()
137137

138-
assert '<script src="_static/sphinx_highlight.js">' in html
138+
assert "sphinx" in html
139139
assert "window.ui = SwaggerUIBundle(config);" in html
140140

141141

0 commit comments

Comments
 (0)