diff options
| author | Luca Vizzarro <[email protected]> | 2024-10-28 11:09:40 +0000 |
|---|---|---|
| committer | Luca Vizzarro <[email protected]> | 2024-11-11 14:43:21 +0100 |
| commit | 6597fa4a30add6e0790f0e25833c3e073d76a877 (patch) | |
| tree | 4fb11bf8f77e2247a7428df6d8c23387c2bc09dd /dts | |
| parent | f94100da8ead989c6ff070da1c9a8754d69207e9 (diff) | |
dts: add autodoc Pydantic
Add and enable the autodoc-pydantic sphinx extension. Pydantic models
are not correctly recognised by autodoc, causing the generated docs to
lack all the actual model information. The autodoc-pydantic sphinx
extension fixes the original behaviour by correctly formatting them.
Signed-off-by: Luca Vizzarro <[email protected]>
Reviewed-by: Paul Szczepanek <[email protected]>
Reviewed-by: Nicholas Pratte <[email protected]>
Reviewed-by: Patrick Robb <[email protected]>
Diffstat (limited to 'dts')
| -rw-r--r-- | dts/poetry.lock | 59 | ||||
| -rw-r--r-- | dts/pyproject.toml | 1 |
2 files changed, 59 insertions, 1 deletions
diff --git a/dts/poetry.lock b/dts/poetry.lock index 9f7db60793..ee564676b4 100644 --- a/dts/poetry.lock +++ b/dts/poetry.lock @@ -35,6 +35,29 @@ files = [ ] [[package]] +name = "autodoc-pydantic" +version = "2.2.0" +description = "Seamlessly integrate pydantic models in your Sphinx documentation." +optional = false +python-versions = "<4.0.0,>=3.8.1" +files = [ + {file = "autodoc_pydantic-2.2.0-py3-none-any.whl", hash = "sha256:8c6a36fbf6ed2700ea9c6d21ea76ad541b621fbdf16b5a80ee04673548af4d95"}, +] + +[package.dependencies] +pydantic = ">=2.0,<3.0.0" +pydantic-settings = ">=2.0,<3.0.0" +Sphinx = ">=4.0" + +[package.extras] +docs = ["myst-parser (>=3.0.0,<4.0.0)", "sphinx-copybutton (>=0.5.0,<0.6.0)", "sphinx-rtd-theme (>=2.0.0,<3.0.0)", "sphinx-tabs (>=3,<4)", "sphinxcontrib-mermaid (>=0.9.0,<0.10.0)"] +erdantic = ["erdantic (<2.0)"] +linting = ["ruff (>=0.4.0,<0.5.0)"] +security = ["pip-audit (>=2.7.2,<3.0.0)"] +test = ["coverage (>=7,<8)", "defusedxml (>=0.7.1)", "pytest (>=8.0.0,<9.0.0)", "pytest-sugar (>=1.0.0,<2.0.0)"] +type-checking = ["mypy (>=1.9,<2.0)", "types-docutils (>=0.20,<0.21)", "typing-extensions (>=4.11,<5.0)"] + +[[package]] name = "babel" version = "2.13.1" description = "Internationalization utilities" @@ -830,6 +853,26 @@ files = [ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] +name = "pydantic-settings" +version = "2.6.0" +description = "Settings management using Pydantic" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_settings-2.6.0-py3-none-any.whl", hash = "sha256:4a819166f119b74d7f8c765196b165f95cc7487ce58ea27dec8a5a26be0970e0"}, + {file = "pydantic_settings-2.6.0.tar.gz", hash = "sha256:44a1804abffac9e6a30372bb45f6cafab945ef5af25e66b1c634c01dd39e0188"}, +] + +[package.dependencies] +pydantic = ">=2.7.0" +python-dotenv = ">=0.21.0" + +[package.extras] +azure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0)"] +toml = ["tomli (>=2.0.1)"] +yaml = ["pyyaml (>=6.0.1)"] + +[[package]] name = "pydocstyle" version = "6.1.1" description = "Python docstring style checker" @@ -936,6 +979,20 @@ docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] [[package]] +name = "python-dotenv" +version = "1.0.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, + {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" @@ -1304,4 +1361,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "310e2d3725e20ffc6ef017db92e8000c042eb2ac98a1a5eb441de17c87417e9f" +content-hash = "fe9a9fdf7b43e8dce2fb5ee600921d4047fef2f4037a78bbd150f71df202493e" diff --git a/dts/pyproject.toml b/dts/pyproject.toml index 9a3fb02ee9..f69c70877a 100644 --- a/dts/pyproject.toml +++ b/dts/pyproject.toml @@ -44,6 +44,7 @@ optional = true sphinx = "<=7" sphinx-rtd-theme = ">=1.2.2" pyelftools = "^0.31" +autodoc-pydantic = "^2.2.0" [build-system] requires = ["poetry-core>=1.0.0"] |
