diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b20966e6..7e824369 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,7 @@ on: branches: - main pull_request: + workflow_dispatch: jobs: test-stable-versions: diff --git a/changelog.rst b/changelog.rst index a2615f0d..60d3cde8 100644 --- a/changelog.rst +++ b/changelog.rst @@ -5,22 +5,40 @@ v2.1.0 - 2024-01-XX ------------------- This is a maintenance and bugfix release extending support to pydantic v2.5, -sphinx v7.2 and python 3.12. Python 3.7 is removed from the test matrix and will no -longer be supported. +sphinx v7.2 and python 3.12 while dropping support for python 3.7 which has +reached EOL. Testing ~~~~~~~ - Add pydantic 2.2/2.3/2.4/2.5 to test matrix. -- Add python 3.12 to test matrix. - Add sphinx 7.1/7.2 to test matrix. +- Add python 3.12 to test matrix. +- Remove python 3.7 from test matrix. - Remove obsolete `skip ci` condition from github actions. +- Update ``conftest`` to use ``pathlib`` instead of older Sphinx + ``sphinx.testing.path`` module that is being deprecated for + forward-compatibility with newer Sphinx versions. Bugfix ~~~~~~ - Fix incompatibity with sphinx 7.2 due to changed usage of path objects. For more, see `#11606 `__. +- `#176 `__ - + Remove ``sphinxcontrib/__init__.py`` causing ``ModuleNotFoundError`` + exception in some environments. This should be a namespace package per + `PEP 420 `__ without ``__init_.py`` to + match with other extensions. + +Contributors +~~~~~~~~~~~~ + +- Thanks to `devmonkey22 `__ for providing a PR + to solve a nasty namespace package issue + `#176 `__ and + `daquinteroflex `__ for testing and + providing feedback. v2.0.1 - 2023-08-01 ------------------- diff --git a/sphinxcontrib/__init__.py b/sphinxcontrib/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/conftest.py b/tests/conftest.py index d63e0f94..d81f418e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,6 +7,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 @@ -16,7 +17,7 @@ from sphinx import application from sphinx.application import Sphinx from sphinx.cmd import build -from sphinx.testing.path import path + from sphinx.testing.restructuredtext import parse from sphinx.util.docutils import LoggingReporter from sphinx.ext.autodoc.directive import ( @@ -67,12 +68,12 @@ @pytest.fixture(scope='session') -def rootdir(): - return path(__file__).parent.abspath() / 'roots' +def rootdir() -> Path: + return Path(__file__).parent.resolve() / 'roots' @pytest.fixture(scope='session') -def docdir(): +def docdir() -> Path: """Provides path to actual sphinx documentation of autodoc_pydantic. """ @@ -144,16 +145,12 @@ def create(testroot: str, conf: Optional[Dict] = None, deactivate_all: bool = False): - # workaround for sphinx issue #11605 - testroot = Path(testroot) - srcdir = sphinx_test_tempdir / testroot shutil.rmtree(srcdir, ignore_errors=True) if rootdir and not srcdir.exists(): - testroot_name = testroot.parent / ('test-' + testroot.name) - testroot_path = rootdir / testroot_name - testroot_path.copytree(srcdir) + testroot_path = rootdir / ('test-' + testroot) + shutil.copytree(testroot_path, srcdir) kwargs = dict(srcdir=srcdir, confoverrides={})