Skip to content

Commit

Permalink
Merge pull request #1 from minddistrict/current-python-versions
Browse files Browse the repository at this point in the history
Update to current Python versions.
  • Loading branch information
icemac authored Nov 8, 2023
2 parents d6432e5 + 7b76749 commit 789a768
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
16 changes: 8 additions & 8 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,14 +28,14 @@ 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: |
python -m pip install tox
python -m tox -e docs
python -m tox -e docs
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 @@ -27,7 +27,6 @@
'jinja2 >= 2.4',
'jsonschema >= 3.0',
'sphinx >= 1.5',
'six >= 1.5',
'PyYAML >= 3.12',
],
classifiers=[
Expand All @@ -37,13 +36,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

0 comments on commit 789a768

Please sign in to comment.