From 5469884b54dff3d467550a4d3056302bbe967bd3 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Mon, 2 Mar 2026 20:46:16 -0600 Subject: [PATCH 1/3] Convert doc build to use dependency-groups - Move the doc build requirements into a dependency-group - Replace the framework dependencies with `autodoc_mock_imports`, so that we don't need all of the frameworks installed into a single monolithic virtualenv in order to build docs - Minor doc fix: remove stale `asyncparser` reference --- docs/api.rst | 6 ------ docs/conf.py | 12 ++++++++++++ pyproject.toml | 14 ++++++++------ tox.ini | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index a74fc2d90..1907ba5e3 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -24,12 +24,6 @@ webargs.multidictproxy :members: -webargs.asyncparser -------------------- - -.. automodule:: webargs.asyncparser - :inherited-members: - webargs.flaskparser ------------------- diff --git a/docs/conf.py b/docs/conf.py index 0d84d592c..f496114fe 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,6 +20,18 @@ "marshmallow": ("http://marshmallow.readthedocs.io/en/latest/", None), } +autodoc_mock_imports = [ + "aiohttp", + "bottle", + "django", + "falcon", + "flask", + "pyramid", + "tornado", + "webob", + "werkzeug", +] + # The master toctree document. master_doc = "index" diff --git a/pyproject.toml b/pyproject.toml index 07c1224a3..52e3c2e36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,18 +74,20 @@ tests = [ "pytest-aiohttp>=0.3.0", "packaging>=17.0", ] -docs = [ - "webargs[frameworks]", - "Sphinx==9.1.0", - "sphinx-issues==5.0.1", - "furo==2025.12.19", -] dev = ["webargs[tests]", "tox", "pre-commit>=3.5,<5.0"] [build-system] requires = ["flit_core<4"] build-backend = "flit_core.buildapi" +[dependency-groups] +docs = [ + "webargs", + "Sphinx==9.1.0", + "sphinx-issues==5.0.1", + "furo==2025.12.19", +] + [tool.flit.sdist] include = [ "docs/", diff --git a/tox.ini b/tox.ini index ae96ae89b..ec91009ce 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,7 @@ extras = frameworks commands = mypy src/ {posargs} [testenv:docs] -extras = docs +dependency_groups = docs commands = sphinx-build docs/ docs/_build {posargs} ; Below tasks are for development only (not run in CI) From 753279e174cdbe9442d3c3e9459148c33654b8ca Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Mon, 2 Mar 2026 20:53:53 -0600 Subject: [PATCH 2/3] Update RTD config to build with 'docs' dep group Also convert to a uv-based build process which leverages the `tox` docs environment and runs faster than the prior build. --- .readthedocs.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 4bab2023b..b93c34a5d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,12 +4,15 @@ sphinx: formats: - pdf build: - os: ubuntu-22.04 - tools: - python: "3.11" -python: - install: - - method: pip - path: . - extra_requirements: - - docs + os: ubuntu-24.04 + commands: + # setup uv + - asdf plugin add uv + - asdf install uv latest + - asdf global uv latest + # setup tox + tox-uv + - uv tool install tox --with tox-uv --python "3.14" --managed-python + # setup the docs tox environment, but use `--notest` to skip commands + - uv tool run tox run -e docs --notest -vvv + # do the actual build step, to the RTD documented output directory + - uv tool run tox run -e docs --skip-pkg-install -q -- "${READTHEDOCS_OUTPUT}"/html -b dirhtml From 9eed75000ffd44cbc7aded6b8097876647503a53 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Mon, 2 Mar 2026 21:11:22 -0600 Subject: [PATCH 3/3] Convert test and dev dependencies to groups - test dependencies are organized into per-framework groups, and then aggregated in a `test-all-frameworks` group -- which is still used in tox in order to keep test times down - dev dependencies are moved to a dedicated group as well - the 'setuptools' pin for pyramid is moved into the pyramid test group --- pyproject.toml | 58 ++++++++++++++++++++++++++++++++------------------ tox.ini | 8 +------ 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 52e3c2e36..c146054c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,27 +55,6 @@ Issues = "https://github.com/marshmallow-code/webargs/issues" Source = "https://github.com/marshmallow-code/webargs" Tidelift = "https://tidelift.com/subscription/pkg/pypi-webargs?utm_source=pypi-webargs&utm_medium=pypi" -[project.optional-dependencies] -frameworks = [ - "Flask>=3.1.0", - "Django>=5.2.0", - "bottle>=0.13.0", - "tornado>=6.5.0", - "pyramid>=2.0.2", - "falcon>=4.1.0", - "aiohttp>=3.13.0", -] -tests = [ - "webargs[frameworks]", - "pytest", - "pytest-asyncio", - "webtest==3.0.7", - "webtest-aiohttp==2.0.0", - "pytest-aiohttp>=0.3.0", - "packaging>=17.0", -] -dev = ["webargs[tests]", "tox", "pre-commit>=3.5,<5.0"] - [build-system] requires = ["flit_core<4"] build-backend = "flit_core.buildapi" @@ -88,6 +67,43 @@ docs = [ "furo==2025.12.19", ] +tests = [ + "pytest", + "pytest-asyncio", + "webtest==3.0.7", + "webtest-aiohttp==2.0.0", + "pytest-aiohttp>=0.3.0", + "packaging>=17.0", +] +test-flask = ["Flask>=3.1.0", {include-group = "tests"}] +test-django = ["Django>=5.2.0", {include-group = "tests"}] +test-bottle = ["bottle>=0.13.0", {include-group = "tests"}] +test-tornado = ["tornado>=6.5.0", {include-group = "tests"}] +test-pyramid = [ + "pyramid>=2.0.2", {include-group = "tests"}, + # temporary pin: hold back `setuptools` so that `pyramid` testing works + # pyramid uses pkg_resources, which has been long deprecated and finally removed + # + # see https://github.com/Pylons/pyramid/issues/3731 for discussion within pyramid + "setuptools < 82.0" +] +test-falcon = ["falcon>=4.1.0", {include-group = "tests"}] +test-aiohttp = ["aiohttp>=3.13.0", {include-group = "tests"}] +# for efficiency of testing, we define this group and test all frameworks at once, because it works +# however, each is declared separately in case we ever encounter conflicts and need to break one off +# from the rest of the group +test-all-frameworks = [ + {include-group = "test-flask"}, + {include-group = "test-django"}, + {include-group = "test-bottle"}, + {include-group = "test-tornado"}, + {include-group = "test-pyramid"}, + {include-group = "test-falcon"}, + {include-group = "test-aiohttp"}, +] + +dev = ["tox", "pre-commit>=3.5,<5.0", {include-group = "tests"}] + [tool.flit.sdist] include = [ "docs/", diff --git a/tox.ini b/tox.ini index ec91009ce..c7f811194 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ envlist= docs [testenv] -extras = tests +dependency_groups = test-all-frameworks deps = marshmallow: marshmallow>=4.0.0,<5.0.0 marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gz @@ -19,12 +19,6 @@ deps = lowest: falcon==4.1.0 lowest: aiohttp==3.13.0 lowest: marshmallow==3.13.0 - - # temporary pin: hold back `setuptools` so that `pyramid` testing works - # pyramid uses pkg_resources, which has been long deprecated and finally removed - # - # see https://github.com/Pylons/pyramid/issues/3731 for discussion within pyramid - setuptools < 82.0 commands = pytest {posargs} [testenv:lint]