diff --git a/doc/conf.py b/doc/conf.py index 5eb14bc..ece0681 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -24,6 +24,7 @@ sys.path.insert(0, os.path.abspath("..")) +import doc.patch # -- General configuration ------------------------------------------------ diff --git a/doc/patch.py b/doc/patch.py new file mode 100644 index 0000000..ff7571b --- /dev/null +++ b/doc/patch.py @@ -0,0 +1,16 @@ +# this is required to make sphinx able to find references for classes put inside +# typing.TYPE_CHECKING block + +from ssl import SSLContext + +from werkzeug.wrappers import Request +from werkzeug.wrappers import Response + +import pytest_httpserver.blocking_httpserver +import pytest_httpserver.httpserver + +pytest_httpserver.httpserver.SSLContext = SSLContext +pytest_httpserver.blocking_httpserver.SSLContext = SSLContext + +pytest_httpserver.blocking_httpserver.Request = Request +pytest_httpserver.blocking_httpserver.Response = Response diff --git a/pyproject.toml b/pyproject.toml index 26e771d..efab25d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ markers = [ ] [tool.mypy] -files = ["pytest_httpserver", "scripts", "tests", "doc"] +files = ["pytest_httpserver", "scripts", "tests"] implicit_reexport = false diff --git a/tests/test_release.py b/tests/test_release.py index 02e7f64..0067147 100644 --- a/tests/test_release.py +++ b/tests/test_release.py @@ -183,6 +183,7 @@ def test_sdist_contents(build: Build, version: str): "howto.rst", "index.rst", "Makefile", + "patch.py", "tutorial.rst", "upgrade.rst", },