Skip to content

Commit

Permalink
Drop sphinx < 4 and pin versions for CI (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
mansenfranzen authored Apr 12, 2024
1 parent c855a9b commit 6102f99
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Publish
jobs:
publish:
name: Upload to PyPI
environment: Publish
environment: ReleasePlease
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
68 changes: 27 additions & 41 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: Tests
on:
push:
branches:
Expand All @@ -7,43 +7,30 @@ on:

jobs:
test-stable-versions:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
fail-fast: false
matrix:
include:
- python_version: 3.7
pydantic_version: "16"
sphinx_version: "34"
- python_version: 3.8
pydantic_version: "17"
sphinx_version: "35"
sphinx_version: "40"
- python_version: 3.9
pydantic_version: "18"
sphinx_version: "35"
sphinx_version: "40"
- python_version: 3.9
pydantic_version: "18"
sphinx_version: "40"
- python_version: 3.9
pydantic_version: "18"
sphinx_version: "41"
sphinx_version: "45"
- python_version: 3.9
pydantic_version: "18"
sphinx_version: "42"
sphinx_version: "45"
- python_version: 3.9
pydantic_version: "18"
sphinx_version: "43"
sphinx_version: "45"
- python_version: "3.10"
pydantic_version: "18"
sphinx_version: "43"
- python_version: "3.10"
pydantic_version: "19"
sphinx_version: "43"
- python_version: "3.10"
pydantic_version: "19"
sphinx_version: "44"
- python_version: "3.10"
pydantic_version: "19"
sphinx_version: "45"
- python_version: "3.10"
pydantic_version: "19"
Expand All @@ -66,56 +53,57 @@ jobs:
- python_version: "3.10"
pydantic_version: "110"
sphinx_version: "70"
- python_version: "3.11"
pydantic_version: "110"
sphinx_version: "72"
environment: Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- run: sudo apt-get install graphviz graphviz-dev
- run: pip install tox
- run: tox -e pydantic${{ matrix.pydantic_version }}-sphinx${{ matrix.sphinx_version }}
- name: Codecov
uses: codecov/codecov-action@v2.1.0
- name: Code Coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODACY_PROJECT_TOKEN }}

test-latest-version:
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: ci
environment: Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: sudo apt-get install graphviz graphviz-dev
- run: pip install tox
- run: tox -e latest
- name: Codecov
uses: codecov/codecov-action@v2.1.0
- name: Code Coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODACY_PROJECT_TOKEN }}

test-special-version:
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: ci
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install tox
- run: tox -e no_erdantic

test-development-versions-deps:
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: ci
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: sudo apt-get install graphviz graphviz-dev
Expand All @@ -125,12 +113,10 @@ jobs:
- run: echo "Done"

test-linter:
if: "!contains(github.event.head_commit.message, 'skip ci')"
environment: ci
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install tox
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
author = 'Franz Wöllert'

# The full version, including alpha/beta/rc tags
release = '1.9.0'
release = '1.9.1'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "autodoc_pydantic"
version = "1.9.0"
version = "1.9.1"
description = "Seamlessly integrate pydantic models in your Sphinx documentation."
authors = ["mansenfranzen <[email protected]>"]
packages = [{ include = "sphinxcontrib" }]
Expand Down
2 changes: 1 addition & 1 deletion sphinxcontrib/autodoc_pydantic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
PydanticSettings
)

__version__ = "1.8.0"
__version__ = "1.9.1"

from sphinxcontrib.autodoc_pydantic.events import add_fallback_css_class

Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
from logging.handlers import MemoryHandler
from pathlib import Path
import shutil
from typing import Optional, Dict, List, Callable, Union, Any
from unittest.mock import Mock

Expand Down Expand Up @@ -143,11 +144,11 @@ def create(testroot: str,
conf: Optional[Dict] = None,
deactivate_all: bool = False):
srcdir = sphinx_test_tempdir / testroot
srcdir.rmtree(ignore_errors=True)
shutil.rmtree(srcdir, ignore_errors=True)

if rootdir and not srcdir.exists():
testroot_path = rootdir / ('test-' + testroot)
testroot_path.copytree(srcdir)
shutil.copytree(testroot_path, srcdir)

kwargs = dict(srcdir=srcdir, confoverrides={})

Expand Down
12 changes: 6 additions & 6 deletions tests/test_configuration_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,23 @@ def test_autodoc_pydantic_model_erdantic_figure_collapsed_false(autodocument):
},
**kwargs)
print(actual)
assert actual[:10] == result[:10]
assert actual[11:] == result[11:]
assert actual[:11] == result[:11]
assert actual[12:] == result[12:]

# explicit local
actual = autodocument(
options_doc={"model-erdantic-figure": True, "model-erdantic-figure-collapsed": False},
**kwargs)
assert actual[:10] == result[:10]
assert actual[11:] == result[11:]
assert actual[:11] == result[:11]
assert actual[12:] == result[12:]

# explicit local overwrite global
actual = autodocument(
options_app={"autodoc_pydantic_model_erdantic_figure_collapsed": True},
options_doc={"model-erdantic-figure": True, "model-erdantic-figure-collapsed": False},
**kwargs)
assert actual[:10] == result[:10]
assert actual[11:] == result[11:]
assert actual[:11] == result[:11]
assert actual[12:] == result[12:]


@pytest.mark.skipif(package_is_missing('erdantic'), reason="erdantic missing")
Expand Down
28 changes: 18 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{37,38,39,310}-pydantic{15,16,17,18,19,110,latest}-sphinx{34,35,40,41,42,43,44,45,50,51,52,60,61,62,70,latest}, latest, development, no_erdantic, linter
envlist = py{37,38,39,310}-pydantic{15,16,17,18,19,110,latest}-sphinx{40,45,50,51,52,60,61,62,70,71,72,latest}, latest, development, no_erdantic, linter
isolated_build = True

[testenv]
Expand All @@ -22,24 +22,31 @@ deps =
pydantic19: pydantic~=1.9.0
pydantic110: pydantic~=1.10.0
pydanticlatest: pydantic
sphinx34: sphinx~=3.4.0
sphinx34: docutils>=0.14,<0.18
sphinx34: jinja2<3.1.0
sphinx35: sphinx~=3.5.0
sphinx35: jinja2<3.1.0

; pins for sphinx 4.X compatibility from
; https://github.com/sphinx-doc/sphinx/issues/11890
sphinx40: sphinx~=4.0.0
sphinx41: sphinx~=4.1.0
sphinx42: sphinx~=4.2.0
sphinx43: sphinx~=4.3.0
sphinx44: sphinx~=4.4.0
sphinx40: sphinxcontrib-applehelp==1.0.4
sphinx40: sphinxcontrib-devhelp==1.0.2
sphinx40: sphinxcontrib-htmlhelp==2.0.1
sphinx40: sphinxcontrib-qthelp==1.0.3
sphinx40: sphinxcontrib-serializinghtml==1.1.5

sphinx45: sphinx~=4.5.0
sphinx45: sphinxcontrib-applehelp==1.0.4
sphinx45: sphinxcontrib-devhelp==1.0.2
sphinx45: sphinxcontrib-htmlhelp==2.0.1
sphinx45: sphinxcontrib-qthelp==1.0.3
sphinx45: sphinxcontrib-serializinghtml==1.1.5
sphinx50: sphinx~=5.0.0
sphinx51: sphinx~=5.1.0
sphinx52: sphinx~=5.2.0
sphinx60: sphinx~=6.0.0
sphinx61: sphinx~=6.1.0
sphinx62: sphinx~=6.2.0
sphinx70: sphinx~=7.0.0
sphinx71: sphinx~=7.1.0
sphinx72: sphinx~=7.2.0
sphinxlatest: sphinx

[testenv:latest]
Expand Down Expand Up @@ -75,6 +82,7 @@ commands =
flake8 sphinxcontrib/autodoc_pydantic/

[flake8]
max-line-length = 89
ignore =
TYP001
TYP004

0 comments on commit 6102f99

Please sign in to comment.