From e20cabd285532d7bc6dbd95c4c24ecddf926b254 Mon Sep 17 00:00:00 2001 From: Kazuya Takei Date: Tue, 2 Aug 2022 01:31:36 +0900 Subject: [PATCH] fix: Initialize of builders accepts app and env for Sphinx>5.1 Refs: #123 Refs: #124 Refs: https://github.com/sphinx-doc/sphinx/pull/10702 --- .github/workflows/main.yml | 2 +- sphinx_revealjs/builders.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e2df7d..2b6bcf5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: max-parallel: 4 matrix: python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] - sphinx-version: ['>=3.0.0,<4.0.0', '>=4.0.0,<5.0.0', '>=5.0.0,<6.0.0'] + sphinx-version: ['>=3.0.0,<4.0.0', '>=4.0.0,<5.0.0', '>=5.0.0,<5.1.0', '>=5.1.0,<6.0.0'] exclude: # Old major version does not support python 3.10 - python-version: '3.10' diff --git a/sphinx_revealjs/builders.py b/sphinx_revealjs/builders.py index 7bc94e9..7135d6a 100644 --- a/sphinx_revealjs/builders.py +++ b/sphinx_revealjs/builders.py @@ -31,8 +31,8 @@ class RevealjsHTMLBuilder(StandaloneHTMLBuilder): search = False def __init__(self, app, env: BuildEnvironment = None): # noqa: D107 - # TODO: Remove it if this not need support Sphinx 4.x and older - if sphinx_versoin[0] < 5: + # TODO: Remove it if this not need support Sphinx 5.1.0 and older + if sphinx_versoin[0] <= 4 or sphinx_versoin[:2] == (5, 0): super().__init__(app) else: super().__init__(app, env)