Skip to content

Commit

Permalink
Add support for Python 3.7 up to 3.12. (#74)
Browse files Browse the repository at this point in the history
Drop support for Python 3.6 and older.
Fix tests.
Run tests on GHA.
  • Loading branch information
icemac authored Jan 13, 2024
1 parent a0f11fa commit 005bbbb
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 53 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: tests

on:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
strategy:
# We want to see all failures:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-20.04"]
config:
# [Python version, tox env]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]

runs-on: ${{ matrix.os[1] }}
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
Changelog
---------

Version 2.0.0
`````````````

unreleased

- Add support for Python 3.7 up to 3.12.
- Drop support for Python 3.6 and older.


Version 1.8.0
`````````````

Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,16 @@
extlinks = {
'pull': (
'https://github.com/sphinx-contrib/httpdomain/pulls/%s',
'pull request #'),
'pull request #%s'),
'issue': (
'https://github.com/sphinx-contrib/httpdomain/issues/%s',
'issue #'),
'issue #%s'),
'oldpull': (
'https://bitbucket.org/birkenfeld/sphinx-contrib/pull-requests/%s/',
'old pull request #'),
'old pull request #%s'),
'oldissue': (
'https://bitbucket.org/birkenfeld/sphinx-contrib/issues/%s/',
'old issue #')
'old issue #%s')
}

# Suppress nonlocal image warning
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
upload_docs = build_sphinx upload_docs

[bdist_wheel]
universal = 1
universal = 0

[upload_docs]
repository=https://pypi.python.org/pypi
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def readme():
description='Sphinx domain for documenting HTTP APIs',
long_description=readme(),
zip_safe=False,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
python_requires='>=3.7',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand All @@ -39,12 +39,12 @@ def readme():
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'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',
'Topic :: Documentation',
'Topic :: Utilities',
],
Expand Down
2 changes: 1 addition & 1 deletion sphinxcontrib/httpdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, rfc, section):
class EventSourceRef(DocRef):

def __init__(self, section):
url = 'https://www.w3.org/TR/eventsource/'
url = 'https://html.spec.whatwg.org/multipage/server-sent-events.html'
super(EventSourceRef, self).__init__(url, section, '')


Expand Down
23 changes: 11 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[tox]
envlist =
{py36,py35,py27}-{sphinx16,sphinx15}-{flask12,flask11}-{bottle12,bottle11}-{tornado44,tornado45}
py37
py38
py39
py310
py311
py312

[testenv]
deps =
sphinx14: Sphinx >= 1.4.0, < 1.5.0
sphinx15: Sphinx >= 1.5.0, < 1.6.0
sphinx16: Sphinx >= 1.6.0, < 1.7.0
flask11: Flask >= 0.11, < 0.12
flask12: Flask >= 0.11, < 0.13
bottle11: bottle >= 0.11.0, < 0.12.0
bottle12: bottle >= 0.12.0, < 0.13.0
tornado44: tornado >= 4.4, < 4.5
tornado45: tornado >= 4.5, < 4.6
pytest >= 3.3.2, < 4.0.0
Flask
bottle
tornado
pytest
commands =
# test links
py36-sphinx16-flask12-bottle12: sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees doc {envtmpdir}/linkcheck
py37: sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees doc {envtmpdir}/linkcheck
# test html output
sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
pytest

0 comments on commit 005bbbb

Please sign in to comment.