Skip to content

Commit b5d8978

Browse files
authored
chore(pydantic): finalize contrib.pydantic namespace removal (#4733)
The `litestar.contrib.pydantic` namespace was removed from disk in PR #4339, but a few residual references survived: two Sphinx nitpick suppressions in `docs/conf.py` pointing at the deleted `PydanticDTO` and `PydanticPlugin`, four `:class:` cross-references to those same symbols in the historical 2.x release notes, and a dead `[tool.mypy.overrides]` `module` entry in `pyproject.toml` targeting `tests.unit.test_contrib.test_pydantic.*` — a path that no longer exists (pydantic tests live at `tests/unit/test_plugins/test_pydantic/`). This PR cleans them up. The Sphinx suppressions are dropped because the symbols they suppress no longer exist. The four historical cross-references are demoted to plain literal backticks so Sphinx no longer attempts to resolve dead targets. The mypy override is removed; `make lint` clean confirms the pattern was unreachable. No production code is touched and no test behavior changes — the existing pydantic test suite at `tests/unit/test_plugins/test_pydantic/` runs unchanged. Mirrors the `contrib.msgspec` precedent in PR #4730. Verification: `git grep \"litestar\\.contrib\\.pydantic\"` returns nothing outside the historical release notes, `make lint` is clean, the full unit suite (5392 tests) passes, the docs examples pass, and `make docs` builds without warnings. Closes #4722
1 parent a926a2b commit b5d8978

5 files changed

Lines changed: 4 additions & 7 deletions

File tree

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@
190190
(PY_CLASS, "litestar.contrib.mako.P"),
191191
(PY_CLASS, "JWTDecodeOptions"),
192192
(PY_CLASS, "litestar.template.base.P"),
193-
(PY_CLASS, "litestar.contrib.pydantic.PydanticDTO"),
194-
(PY_CLASS, "litestar.contrib.pydantic.PydanticPlugin"),
195193
(PY_CLASS, "typing.Self"),
196194
(PY_CLASS, "attr.AttrsInstance"),
197195
(PY_CLASS, "typing_extensions.TypeGuard"),

docs/release-notes/2.x-changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@
16001600
:pr: 2404
16011601
:issue: 2373
16021602

1603-
A new :class:`~litestar.contrib.pydantic.PydanticPlugin` has been added, which
1603+
A new ``PydanticPlugin`` has been added, which
16041604
can be used to configure Pydantic behaviour. Currently it supports setting a
16051605
``prefer_alias`` option, which will pass the ``by_alias=True`` flag to Pydantic
16061606
when exporting models, as well as generate schemas accordingly.
@@ -2704,7 +2704,7 @@
27042704
`Pydantic <https://docs.pydantic.dev/latest/>`_ have been added:
27052705

27062706
- :class:`~litestar.contrib.msgspec.MsgspecDTO`
2707-
- :class:`~litestar.contrib.pydantic.PydanticDTO`
2707+
- ``PydanticDTO``
27082708

27092709
.. change:: DTOs: Arbitrary generic wrappers
27102710
:pr: 1801

docs/release-notes/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
:issue: 4349
290290

291291
New ``round_trip: bool`` parameter
292-
to :class:`~litestar.contrib.pydantic.PydanticPlugin` allows
292+
to ``PydanticPlugin`` allows
293293
serializing types like ``pydanctic.Json`` correctly.
294294

295295
.. change:: Remove deprecated ``litestar.contrib.minijinja.minijinja_from_state`` function

docs/release-notes/whats-new-2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ and can be used to define DTOs:
439439
- :class:`litestar.dto.dataclass_dto.DataclassDTO`
440440
- :class:`litestar.dto.msgspec_dto.MsgspecDTO`
441441
- :class:`advanced_alchemy.extensions.litestar.dto.SQLAlchemyDTO`
442-
- :class:`litestar.contrib.pydantic.PydanticDTO`
442+
- ``litestar.contrib.pydantic.PydanticDTO``
443443
- :class:`!litestar.contrib.piccolo.PiccoloDTO`
444444

445445
For example, to define a DTO from a dataclass:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ module = [
302302
"litestar.contrib.sqlalchemy.*",
303303
"litestar.plugins.pydantic.*",
304304
"tests.unit.test_contrib.test_sqlalchemy",
305-
"tests.unit.test_contrib.test_pydantic.*",
306305
"tests.unit.test_logging.test_logging_config",
307306
"litestar.openapi.spec.base",
308307
"litestar.utils.helpers",

0 commit comments

Comments
 (0)