diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ff601c2..8d25c52c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bcc8855b..14a7e6bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: ci +name: Tests on: push: branches: @@ -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" @@ -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 @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index 099b8a7e..57e8af2c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 3a14e6bc..836d3cb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] packages = [{ include = "sphinxcontrib" }] diff --git a/sphinxcontrib/autodoc_pydantic/__init__.py b/sphinxcontrib/autodoc_pydantic/__init__.py index fafc262e..efce0f4d 100644 --- a/sphinxcontrib/autodoc_pydantic/__init__.py +++ b/sphinxcontrib/autodoc_pydantic/__init__.py @@ -26,7 +26,7 @@ PydanticSettings ) -__version__ = "1.8.0" +__version__ = "1.9.1" from sphinxcontrib.autodoc_pydantic.events import add_fallback_css_class diff --git a/tests/conftest.py b/tests/conftest.py index c417fa68..0ffcdf0f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 @@ -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={}) diff --git a/tests/test_configuration_model.py b/tests/test_configuration_model.py index ae9d45da..3a1d0b96 100644 --- a/tests/test_configuration_model.py +++ b/tests/test_configuration_model.py @@ -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") diff --git a/tox.ini b/tox.ini index a1cd1700..13018a0f 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -22,17 +22,22 @@ 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 @@ -40,6 +45,8 @@ deps = 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] @@ -75,6 +82,7 @@ commands = flake8 sphinxcontrib/autodoc_pydantic/ [flake8] +max-line-length = 89 ignore = TYP001 TYP004 \ No newline at end of file