Skip to content

Commit

Permalink
Add support for python 3.12 (#56)
Browse files Browse the repository at this point in the history
Closes #55
  • Loading branch information
kasium authored Aug 11, 2023
1 parent 11580f0 commit 3608902
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ on:
branches: [ main ]

jobs:
ci:
ci-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install project
run: pip install -e .[dev,test]
- name: run pre-commit
run: "pre-commit run --all"
ci-test:
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.0-rc.1"]
sphinx-version: ["6.*", "7.*"]
runs-on: ubuntu-latest
steps:
Expand All @@ -22,11 +35,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: pip install -e .[dev]
run: pip install -e .[test]
- name: Install sphinx
run: pip install sphinx==${{ matrix.sphinx-version }}
- name: run pre-commit
run: "pre-commit run --all"
- name: run tests (with coverage)
run: "pytest --cov swagger_plugin_for_sphinx --cov-report html --cov-report xml tests/"
- name: run diff-cover
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version: "3.11"
- name: Install project
run: pip install -e .[dev]
run: pip install -e .
- name: Install libraries
run: pip install -U build twine
- name: Create wheel
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.3.0

* Support python 3.12

## 3.2.0

* Support for inline swagger pages
Expand Down
27 changes: 16 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

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

[project.optional-dependencies]
dev = [
"pre-commit==3.3.2",
"pylint==2.17.4",
"pytest==7.3.1",
"pytest-mock==3.10.0",
"coverage==7.2.0",
"diff-cover==7.5.0",
"pytest-cov==4.1.0",
"black==23.3.0",
"pre-commit==3.3.3",
"pylint==2.17.5",
"black==23.7.0",
"isort==5.12.0",
"flake8==6.0.0",
"mypy==1.3.0",
"flake8==6.1.0",
"mypy==1.5.0",
"types-docutils==0.20.0.1"
]
test = [
"pytest==7.4.0",
"pytest-mock==3.11.1",
"coverage==7.2.7",
"diff-cover==7.7.0",
"pytest-cov==4.1.0",
]

[tool.setuptools.packages.find]
include = ["swagger_plugin_for_sphinx"]
Expand All @@ -74,6 +77,7 @@ warn_incomplete_stub = true
warn_no_return = true
warn_unreachable = true
strict = true
python_version = "3.8"
# output
pretty = true
show_column_numbers = true
Expand All @@ -88,6 +92,7 @@ min-public-methods = 0

[tool.pylint.master]
max-line-length = 100
py-version = [3, 8]

[tool.pylint."messages control"]
enable = ["all"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_inline(sphinx_runner: SphinxRunner, tmp_path: Path) -> None:
with open(build / "api.html", encoding="utf-8") as file:
html = file.read()

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


Expand Down

0 comments on commit 3608902

Please sign in to comment.