Skip to content

Commit 65cf032

Browse files
authored
Merge pull request #1039 from sirosen/convert-to-dependency-groups
Convert optional-dependencies to dependency-groups
2 parents abf3969 + 9eed750 commit 65cf032

File tree

5 files changed

+63
-42
lines changed

5 files changed

+63
-42
lines changed

.readthedocs.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ sphinx:
44
formats:
55
- pdf
66
build:
7-
os: ubuntu-22.04
8-
tools:
9-
python: "3.11"
10-
python:
11-
install:
12-
- method: pip
13-
path: .
14-
extra_requirements:
15-
- docs
7+
os: ubuntu-24.04
8+
commands:
9+
# setup uv
10+
- asdf plugin add uv
11+
- asdf install uv latest
12+
- asdf global uv latest
13+
# setup tox + tox-uv
14+
- uv tool install tox --with tox-uv --python "3.14" --managed-python
15+
# setup the docs tox environment, but use `--notest` to skip commands
16+
- uv tool run tox run -e docs --notest -vvv
17+
# do the actual build step, to the RTD documented output directory
18+
- uv tool run tox run -e docs --skip-pkg-install -q -- "${READTHEDOCS_OUTPUT}"/html -b dirhtml

docs/api.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ webargs.multidictproxy
2424
:members:
2525

2626

27-
webargs.asyncparser
28-
-------------------
29-
30-
.. automodule:: webargs.asyncparser
31-
:inherited-members:
32-
3327
webargs.flaskparser
3428
-------------------
3529

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
"marshmallow": ("http://marshmallow.readthedocs.io/en/latest/", None),
2121
}
2222

23+
autodoc_mock_imports = [
24+
"aiohttp",
25+
"bottle",
26+
"django",
27+
"falcon",
28+
"flask",
29+
"pyramid",
30+
"tornado",
31+
"webob",
32+
"werkzeug",
33+
]
34+
2335

2436
# The master toctree document.
2537
master_doc = "index"

pyproject.toml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,54 @@ Issues = "https://github.com/marshmallow-code/webargs/issues"
5555
Source = "https://github.com/marshmallow-code/webargs"
5656
Tidelift = "https://tidelift.com/subscription/pkg/pypi-webargs?utm_source=pypi-webargs&utm_medium=pypi"
5757

58-
[project.optional-dependencies]
59-
frameworks = [
60-
"Flask>=3.1.0",
61-
"Django>=5.2.0",
62-
"bottle>=0.13.0",
63-
"tornado>=6.5.0",
64-
"pyramid>=2.0.2",
65-
"falcon>=4.1.0",
66-
"aiohttp>=3.13.0",
58+
[build-system]
59+
requires = ["flit_core<4"]
60+
build-backend = "flit_core.buildapi"
61+
62+
[dependency-groups]
63+
docs = [
64+
"webargs",
65+
"Sphinx==9.1.0",
66+
"sphinx-issues==5.0.1",
67+
"furo==2025.12.19",
6768
]
69+
6870
tests = [
69-
"webargs[frameworks]",
7071
"pytest",
7172
"pytest-asyncio",
7273
"webtest==3.0.7",
7374
"webtest-aiohttp==2.0.0",
7475
"pytest-aiohttp>=0.3.0",
7576
"packaging>=17.0",
7677
]
77-
docs = [
78-
"webargs[frameworks]",
79-
"Sphinx==9.1.0",
80-
"sphinx-issues==5.0.1",
81-
"furo==2025.12.19",
78+
test-flask = ["Flask>=3.1.0", {include-group = "tests"}]
79+
test-django = ["Django>=5.2.0", {include-group = "tests"}]
80+
test-bottle = ["bottle>=0.13.0", {include-group = "tests"}]
81+
test-tornado = ["tornado>=6.5.0", {include-group = "tests"}]
82+
test-pyramid = [
83+
"pyramid>=2.0.2", {include-group = "tests"},
84+
# temporary pin: hold back `setuptools` so that `pyramid` testing works
85+
# pyramid uses pkg_resources, which has been long deprecated and finally removed
86+
#
87+
# see https://github.com/Pylons/pyramid/issues/3731 for discussion within pyramid
88+
"setuptools < 82.0"
89+
]
90+
test-falcon = ["falcon>=4.1.0", {include-group = "tests"}]
91+
test-aiohttp = ["aiohttp>=3.13.0", {include-group = "tests"}]
92+
# for efficiency of testing, we define this group and test all frameworks at once, because it works
93+
# however, each is declared separately in case we ever encounter conflicts and need to break one off
94+
# from the rest of the group
95+
test-all-frameworks = [
96+
{include-group = "test-flask"},
97+
{include-group = "test-django"},
98+
{include-group = "test-bottle"},
99+
{include-group = "test-tornado"},
100+
{include-group = "test-pyramid"},
101+
{include-group = "test-falcon"},
102+
{include-group = "test-aiohttp"},
82103
]
83-
dev = ["webargs[tests]", "tox", "pre-commit>=3.5,<5.0"]
84104

85-
[build-system]
86-
requires = ["flit_core<4"]
87-
build-backend = "flit_core.buildapi"
105+
dev = ["tox", "pre-commit>=3.5,<5.0", {include-group = "tests"}]
88106

89107
[tool.flit.sdist]
90108
include = [

tox.ini

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ envlist=
77
docs
88

99
[testenv]
10-
extras = tests
10+
dependency_groups = test-all-frameworks
1111
deps =
1212
marshmallow: marshmallow>=4.0.0,<5.0.0
1313
marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gz
@@ -19,12 +19,6 @@ deps =
1919
lowest: falcon==4.1.0
2020
lowest: aiohttp==3.13.0
2121
lowest: marshmallow==3.13.0
22-
23-
# temporary pin: hold back `setuptools` so that `pyramid` testing works
24-
# pyramid uses pkg_resources, which has been long deprecated and finally removed
25-
#
26-
# see https://github.com/Pylons/pyramid/issues/3731 for discussion within pyramid
27-
setuptools < 82.0
2822
commands = pytest {posargs}
2923

3024
[testenv:lint]
@@ -41,7 +35,7 @@ extras = frameworks
4135
commands = mypy src/ {posargs}
4236

4337
[testenv:docs]
44-
extras = docs
38+
dependency_groups = docs
4539
commands = sphinx-build docs/ docs/_build {posargs}
4640

4741
; Below tasks are for development only (not run in CI)

0 commit comments

Comments
 (0)