From 835eddbaceab5cabc67150aedc6a991ddead0b5e Mon Sep 17 00:00:00 2001 From: theOehrly <23384863+theOehrly@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:29:26 +0200 Subject: [PATCH 1/5] fix deprecations introduced by sphinx v8 --- conftest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/conftest.py b/conftest.py index 06f8759..1b56730 100644 --- a/conftest.py +++ b/conftest.py @@ -1,13 +1,17 @@ import os.path as osp -import sys import pytest +import sphinx +import sys +from packaging.version import Version -from sphinx.testing.path import path +if Version(sphinx.__version__) < Version("8.0.0"): + from sphinx.testing.path import path +else: + from pathlib import Path as path pytest_plugins = 'sphinx.testing.fixtures' - sphinx_supp = osp.abspath(osp.join(osp.dirname(__file__), "tests")) From 71531bbe4aa39dd13ae9d9c3cb6376327979bc8e Mon Sep 17 00:00:00 2001 From: theOehrly <23384863+theOehrly@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:54:39 +0200 Subject: [PATCH 2/5] allow sphinx v8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ed77240..21ad234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ requires-python = '>= 3.7' dependencies = [ - 'Sphinx >= 2.2, < 8.0', + 'Sphinx >= 2.2, < 9.0', ] [project.urls] From dc36ddc209cd32d7b6374765eae8e2806d81d904 Mon Sep 17 00:00:00 2001 From: theOehrly <23384863+theOehrly@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:55:11 +0200 Subject: [PATCH 3/5] fix tests and rework test workflow --- .github/workflows/build.yml | 40 ++++++++++ .github/workflows/python-app.yml | 127 +++++++++++++++++++------------ 2 files changed, 120 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..637f8c3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Tests + +on: + workflow_call: + inputs: + python-version: + required: true + type: string + extra-requirements: + required: false + type: string + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ inputs.python-version }} + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov codecov beautifulsoup4 ${{ inputs.extra-requirements }} -e . + - name: Test with pytest + run: | + pytest --cov=autodocsumm --cov-report=xml tests + - name: Upload codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + codecov diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 017ff93..a0afeb3 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -8,62 +8,95 @@ on: pull_request: jobs: - build: - runs-on: ubuntu-latest + build-sphinx-80plus: + name: Build + strategy: + fail-fast: false + matrix: + python-version: [ "3.10", "3.11", "3.12" ] + sphinx-version: [ + "8.0.*", "8.*" # 8.0.x and latest + ] + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python-version }} + extra-requirements: '\ + "sphinx==${{ matrix.sphinx-version }}"' + + + build-legacy-sphinx-45plus: + name: Build strategy: + fail-fast: false matrix: - python-version: ["3.8", "3.9"] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] sphinx-version: [ - "7.0.*", "7.1.*", "7.2.*", + "7.0.*", "7.1.*", "7.2.*", "6.0.*", "5.0.*", - "4.5", "4.4", "4.3", "4.2", "4.1", "4.0.*", - "3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*", + "4.5.*" ] - include: - - python-version: "3.7" - sphinx-version: "" - - python-version: "3.7" - sphinx-version: "3.5" - - python-version: "3.10" - sphinx-version: "" - - python-version: "3.10" - sphinx-version: "4.5" - - python-version: "3.11" - sphinx-version: "" - - python-version: "3.11" - sphinx-version: "4.5" exclude: - python-version: "3.8" sphinx-version: "7.2.*" + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python-version }} + extra-requirements: '\ + "sphinx==${{ matrix.sphinx-version }}" + "sphinxcontrib-applehelp<1.0.8" + "sphinxcontrib-devhelp<1.0.6" + "sphinxcontrib-htmlhelp<2.0.5" + "sphinxcontrib-jsmath<1.0.1" + "sphinxcontrib-qthelp<1.0.7" + "sphinxcontrib-serializinghtml<1.1.10"' + + + build-legacy-sphinx-40plus: + name: Build - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - name: Install dependencies - env: - SPHINX_VERSION: ${{ matrix.sphinx-version }} - run: | - python -m pip install --upgrade pip - SPHINX=Sphinx - JINJA2=jinja2 - if [[ $SPHINX_VERSION != "" ]]; then - SPHINX="${SPHINX}==${SPHINX_VERSION}"; - JINJA2="${JINJA2}<3.1"; - fi - pip install pytest pytest-cov codecov "${SPHINX}" "${JINJA2}" beautifulsoup4 -e . - - name: Test with pytest - run: | - pytest --cov=autodocsumm --cov-report=xml tests - - name: Upload codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: | - codecov + strategy: + fail-fast: false + matrix: + python-version: [ "3.8", "3.9" ] + sphinx-version: [ + "4.4.*", "4.3.*", "4.2.*", "4.1.*", "4.0.*" + ] + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python-version }} + extra-requirements: '\ + "sphinx==${{ matrix.sphinx-version }}" + "sphinxcontrib-applehelp<1.0.8" + "sphinxcontrib-devhelp<1.0.6" + "sphinxcontrib-htmlhelp<2.0.5" + "sphinxcontrib-jsmath<1.0.1" + "sphinxcontrib-qthelp<1.0.7" + "sphinxcontrib-serializinghtml<1.1.10"' + + + build-legacy-sphinx-30plus: + name: Build + + strategy: + fail-fast: false + matrix: + python-version: [ "3.7", "3.8", "3.9" ] + sphinx-version: [ + "3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*", + ] + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python-version }} + extra-requirements: '\ + "sphinx==${{ matrix.sphinx-version }}" + "jinja2<3.1" + "alabaster<0.7.14" + "sphinxcontrib-applehelp<1.0.8" + "sphinxcontrib-devhelp<1.0.6" + "sphinxcontrib-htmlhelp<2.0.5" + "sphinxcontrib-jsmath<1.0.1" + "sphinxcontrib-qthelp<1.0.7" + "sphinxcontrib-serializinghtml<1.1.10"' From f4b92fcbe6a09807be4148986d02c6ac28d3ca3e Mon Sep 17 00:00:00 2001 From: theOehrly <23384863+theOehrly@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:53:29 +0200 Subject: [PATCH 4/5] reduce test matrix again --- .github/workflows/python-app.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a0afeb3..9f40900 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,14 +33,14 @@ jobs: matrix: python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] sphinx-version: [ - "7.0.*", "7.1.*", "7.2.*", - "6.0.*", - "5.0.*", - "4.5.*" + "7.0.*", # possible range: 7.0.0 - 7.4.7 + "6.0.*", # possible range: 6.0.0 - 6.2.1 + "5.0.*", # possible range: 5.0.0 - 5.3.0 + "4.5.*" # possible range: 4.5.0, also latest that supports py3.8 ] - exclude: - - python-version: "3.8" - sphinx-version: "7.2.*" + include: + - python-version: "3.9" + sphinx-version: "7.2.*" # latest version that supports py3.9 uses: ./.github/workflows/build.yml with: python-version: ${{ matrix.python-version }} @@ -62,7 +62,7 @@ jobs: matrix: python-version: [ "3.8", "3.9" ] sphinx-version: [ - "4.4.*", "4.3.*", "4.2.*", "4.1.*", "4.0.*" + "4.0.*" # possible range: 4.0.0 - 4.4.0 ] uses: ./.github/workflows/build.yml with: @@ -85,8 +85,11 @@ jobs: matrix: python-version: [ "3.7", "3.8", "3.9" ] sphinx-version: [ - "3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*", + "3.0.*", # possible range: 3.0.0 - 3.5.4 ] + include: + - python-version: "3.7" + sphinx-version: "3.5.*" # latest version that supports py3.7 uses: ./.github/workflows/build.yml with: python-version: ${{ matrix.python-version }} From e5b8062b5f00834f280dbec6a85af4c63a8f9daa Mon Sep 17 00:00:00 2001 From: theOehrly <23384863+theOehrly@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:57:30 +0200 Subject: [PATCH 5/5] allow python 3.12 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 21ad234..2d1c75d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Operating System :: OS Independent', ]