Skip to content

Commit 2f2b447

Browse files
lesnik512claude
andcommitted
feat(extras): move pydantic to optional-dependencies + bump to 0.3.0
pydantic moves from [project] dependencies to [project.optional-dependencies]. Install httpware[pydantic] to keep the default-decoder UX; the all extra now bundles pydantic, msgspec, and otel. Breaking change. See planning/releases/0.3.0.md for the full migration story. Part of the 0.3.0 pydantic-optional-extra work. Also applies ruff formatting fixes to two test files from prior units that were already unformatted on this branch (required to pass lint-ci). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent abee47f commit 2f2b447

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎pyproject.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ classifiers = [
2626
"Topic :: Internet :: WWW/HTTP",
2727
"Framework :: AsyncIO",
2828
]
29-
version = "0.2.0"
29+
version = "0.3.0"
3030
dependencies = [
3131
"httpx2>=2.0.0,<3.0",
32-
"pydantic>=2.0,<3.0",
3332
]
3433

3534
[project.optional-dependencies]
35+
pydantic = ["pydantic>=2.0,<3.0"]
3636
msgspec = ["msgspec>=0.18"]
3737
otel = [
3838
"opentelemetry-api>=1.20",
3939
"opentelemetry-sdk>=1.20",
4040
]
41-
all = ["httpware[msgspec,otel]"]
41+
all = ["httpware[pydantic,msgspec,otel]"]
4242

4343
[project.urls]
4444
repository = "https://github.com/modern-python/httpware"

‎tests/test_optional_extras_isolation.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@ def test_importing_httpware_does_not_import_pydantic() -> None:
4242
capture_output=True,
4343
)
4444
assert result.returncode == 0, (
45-
f"pydantic was loaded transitively by `import httpware`; "
46-
f"stdout={result.stdout!r} stderr={result.stderr!r}"
45+
f"pydantic was loaded transitively by `import httpware`; stdout={result.stdout!r} stderr={result.stderr!r}"
4746
)

‎tests/test_optional_extras_pydantic_missing.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515

1616

1717
def test_pydantic_decoder_init_raises_when_pydantic_missing() -> None:
18-
with patch("httpware._internal.import_checker.is_pydantic_installed", False), pytest.raises(
19-
ImportError, match=r"httpware\[pydantic\]"
18+
with (
19+
patch("httpware._internal.import_checker.is_pydantic_installed", False),
20+
pytest.raises(ImportError, match=r"httpware\[pydantic\]"),
2021
):
2122
PydanticDecoder()
2223

2324

2425
def test_async_client_default_decoder_raises_when_pydantic_missing() -> None:
25-
with patch("httpware._internal.import_checker.is_pydantic_installed", False), pytest.raises(
26-
ImportError, match=r"httpware\[pydantic\]"
26+
with (
27+
patch("httpware._internal.import_checker.is_pydantic_installed", False),
28+
pytest.raises(ImportError, match=r"httpware\[pydantic\]"),
2729
):
2830
AsyncClient()
2931

0 commit comments

Comments
 (0)