diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 276708b..76473f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,14 +9,14 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -28,12 +28,12 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Run sphinx run: | @@ -43,12 +43,12 @@ jobs: linkcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Run sphinx run: | diff --git a/CHANGES.rst b/CHANGES.rst index c9843c9..31a04e7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +2.0 (unreleased) +```````````````` + +- Drop support for Python 2.7, 3.5, 3.6. +- Add support for Python 3.9, 3.10, 3.11, 3.12. + + 1.6.0 (2020-04-17) `````````````````` diff --git a/docs/conf.py b/docs/conf.py index 43ae451..ac46088 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,8 +13,8 @@ exclude_patterns = ['_build'] pygments_style = 'sphinx' extlinks = { - 'issue': ('https://github.com/ikalnytskyi/sphinxcontrib-redoc/issues/%s', '#'), - 'pr': ('https://github.com/ikalnytskyi/sphinxcontrib-redoc/pull/%s', 'PR #'), + 'issue': ('https://github.com/ikalnytskyi/sphinxcontrib-redoc/issues/%s', '#%s'), + 'pr': ('https://github.com/ikalnytskyi/sphinxcontrib-redoc/pull/%s', 'PR #%s'), } redoc = [ { diff --git a/setup.py b/setup.py index 1c177b7..b2de312 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ 'jinja2 >= 2.4', 'jsonschema >= 3.0', 'sphinx >= 1.5', - 'six >= 1.5', 'PyYAML >= 3.12', ], classifiers=[ @@ -40,13 +39,13 @@ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], namespace_packages=['sphinxcontrib'], ) diff --git a/sphinxcontrib/redoc.py b/sphinxcontrib/redoc.py index 6e1c194..78308c7 100644 --- a/sphinxcontrib/redoc.py +++ b/sphinxcontrib/redoc.py @@ -9,16 +9,15 @@ :license: BSD, see LICENSE for details. """ -import io import os import json +import urllib import jinja2 import jsonschema import pkg_resources import yaml -from six.moves import urllib from sphinx.util.fileutil import copy_asset from sphinx.util.osutil import copyfile, ensuredir @@ -69,8 +68,8 @@ def render(app): jsonschema.validate(app.config.redoc, schema=_REDOC_CONF_SCHEMA) except jsonschema.ValidationError as exc: raise ValueError( - 'Improper configuration for sphinxcontrib-redoc at %s: %s' % ( - '.'.join((str(part) for part in exc.path)), + 'Improper configuration for sphinxcontrib-redoc at {}: {}'.format( + '.'.join(str(part) for part in exc.path), exc.message, ) ) @@ -81,7 +80,7 @@ def render(app): else: template_path = os.path.join(_HERE, 'redoc.j2') - with io.open(template_path, encoding='utf-8') as f: + with open(template_path, encoding='utf-8') as f: template = jinja2.Template(f.read()) # In embed mode, we are going to embed the whole OpenAPI spec into @@ -90,7 +89,7 @@ def render(app): if ctx.get('embed') is True: # Parse & dump the spec to have it as properly formatted json specfile = os.path.join(app.confdir, ctx['spec']) - with io.open(specfile, encoding='utf-8') as specfp: + with open(specfile, encoding='utf-8') as specfp: try: spec_contents = yaml.safe_load(specfp) except ValueError as ver: diff --git a/tox.ini b/tox.ini index d7ab500..35c76c8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py2, py3, docs +envlist = py37, py38, py39, py310, py311, py312, docs [testenv] deps =