From 005bbbb7ab32069b7adb6020a2ddf7b84969762c Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Sat, 13 Jan 2024 08:01:18 +0100 Subject: [PATCH] Add support for Python 3.7 up to 3.12. (#74) Drop support for Python 3.6 and older. Fix tests. Run tests on GHA. --- .github/workflows/tests.yml | 48 +++++++++++++++++++++++++++++++++++++ .travis.yml | 31 ------------------------ doc/changelog.rst | 9 +++++++ doc/conf.py | 8 +++---- setup.cfg | 2 +- setup.py | 8 +++---- sphinxcontrib/httpdomain.py | 2 +- tox.ini | 23 +++++++++--------- 8 files changed, 78 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..3e776d2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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] }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 50379b0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: python -python: [3.6, 3.5, 2.7] -branches: - only: - - main -install: -- pip install tox-travis -script: -- tox -- '[[ "$TRAVIS_TAG" = "" ]] || [[ "$TRAVIS_TAG" = "$(python setup.py --version)" ]]' -- | - env | grep TRAVIS | sort - set -x - if git show --format=%B --quiet "${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_TAG:-${TRAVIS_COMMIT}}}" \ - | grep '\[changelog skip\]' > /dev/null; then - echo "Skip changelog checker..." - elif [[ "$TRAVIS_TAG" != "" ]]; then - ! grep -i "to be released" doc/changelog.rst - else - [[ "$TRAVIS_COMMIT_RANGE" = "" ]] || \ - [[ "$(git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep doc/changelog\.rst)" != "" ]] - fi -deploy: - provider: pypi - distributions: 'sdist bdist_wheel' - on: - tags: true - python: 3.6 - user: sphinxcontrib-httpdomain - password: - secure: "G7t+FEC00x4cuM7jaXeV2MPy5tTn2YL+JztqUJMsDWMo4TLCBmn8Fet1cZEago35Ey2W3vxDcm8Od94KkBUnSwRiAghXDU9MytlHDqnuIH5J51qlU1XSVSGOj4pMLP8n3GEi2wjvt2RLRMTH2ShBaUpRNeVvxHanGTa4YwKZwheAdUVVz0d+IPdFHf2GxS+yRuPDbvWrXOh5rGR2AxvYC/5srin8cIeOrMKh6nE0sSYyI/DNQoLiokVe1GBBCavC1J6xnU5IRA5HnFto0zrpG66ESJWvb3e30lwcRHxLC20OEZ5S/UT8jOrkqZNrGFGqhWgC3FPquUP4OVddD21yn/MfhgO2viGMfw/4YXBNoVac8ATOCK4AhqrWp3EQj772boU+BrvIYfo2yrE/zBkgACZ6chsU6NJVCeiWwrCD5z/IHFXy9UqBK2PwNlioH0P9cHWbgytTr1ZgHUXKE3GuoA61a07QHCRrUYaTr+GHS1DEMrWouqSANUrA61c91m4VuqovoEBuoBtiAXfacAM8renJG7xXrBmAYMrUH5PmMozmyrQFb3Dh130DL5ltEpAidvbnSGKZCIpBCmf4GXKapz1Sr0nyBXE9Oc1ZqQYgI0NtsPUL4aunPsmlmT2UoA6a3ScvwWJeu7kcmgdYFSaaWUzTSzRqgugr7h/DTkMhn7g=" diff --git a/doc/changelog.rst b/doc/changelog.rst index c6a7bd4..c137b40 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -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 ````````````` diff --git a/doc/conf.py b/doc/conf.py index 13507de..f4f1481 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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 diff --git a/setup.cfg b/setup.cfg index de2c8b7..78d03f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ upload_docs = build_sphinx upload_docs [bdist_wheel] -universal = 1 +universal = 0 [upload_docs] repository=https://pypi.python.org/pypi diff --git a/setup.py b/setup.py index d662f5a..32d3db4 100644 --- a/setup.py +++ b/setup.py @@ -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', @@ -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', ], diff --git a/sphinxcontrib/httpdomain.py b/sphinxcontrib/httpdomain.py index 84578c2..e8913b0 100644 --- a/sphinxcontrib/httpdomain.py +++ b/sphinxcontrib/httpdomain.py @@ -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, '') diff --git a/tox.ini b/tox.ini index 63429a5..736c9ac 100644 --- a/tox.ini +++ b/tox.ini @@ -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