Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to current Python versions. #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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: |
Expand All @@ -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: |
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
``````````````````

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
'jinja2 >= 2.4',
'jsonschema >= 3.0',
'sphinx >= 1.5',
'six >= 1.5',
'PyYAML >= 3.12',
],
classifiers=[
Expand All @@ -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'],
)
11 changes: 5 additions & 6 deletions sphinxcontrib/redoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)
)
Expand All @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py2, py3, docs
envlist = py37, py38, py39, py310, py311, py312, docs

[testenv]
deps =
Expand Down