diff --git a/documentation/conf.py b/documentation/conf.py index 3bdf34b2..5c8d4a04 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -20,6 +20,7 @@ "sphinx.ext.intersphinx", "sphinx.ext.todo", "sphinx.ext.viewcode", + "sphinxcontrib.autodoc_pydantic", ] templates_path = ["_templates"] @@ -90,3 +91,13 @@ # -- Options for autosectionlabel ----------------------------------------- autosectionlabel_prefix_document = True + +# -- Options for autodo_pydantic_settings ------------------------------------------- + +autodoc_pydantic_model_show_json = False +autodoc_pydantic_model_show_config_summary = False +autodoc_pydantic_model_show_config_summary = False +autodoc_pydantic_model_show_validator_summary = False +autodoc_pydantic_model_show_validator_members = False +autodoc_pydantic_model_show_field_summary = False +autodoc_pydantic_field_list_validators = False diff --git a/documentation/maintainers/index.rst b/documentation/maintainers/index.rst index 7c9a76e2..3a3f5faa 100644 --- a/documentation/maintainers/index.rst +++ b/documentation/maintainers/index.rst @@ -7,4 +7,5 @@ Cette partie de la documentation est à destination des personnes qui déploient :maxdepth: 2 pullRequestValidation + settings meetingFiles diff --git a/documentation/maintainers/settings.rst b/documentation/maintainers/settings.rst new file mode 100644 index 00000000..6c5da327 --- /dev/null +++ b/documentation/maintainers/settings.rst @@ -0,0 +1,4 @@ +Configuration +############# + +.. autopydantic_model:: flaskr.settings.MainSettings diff --git a/poetry.lock b/poetry.lock index 577f2261..afa294ab 100644 --- a/poetry.lock +++ b/poetry.lock @@ -71,6 +71,29 @@ files = [ {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, ] +[[package]] +name = "autodoc-pydantic" +version = "2.0.1" +description = "Seamlessly integrate pydantic models in your Sphinx documentation." +optional = false +python-versions = ">=3.7.1,<4.0.0" +files = [ + {file = "autodoc_pydantic-2.0.1-py3-none-any.whl", hash = "sha256:d3c302fdb6d37edb5b721f0f540252fa79cea7018bc1a9a85bf70f33a68b0ce4"}, + {file = "autodoc_pydantic-2.0.1.tar.gz", hash = "sha256:7a125a4ff18e4903e27be71e4ddb3269380860eacab4a584d6cc2e212fa96991"}, +] + +[package.dependencies] +importlib-metadata = {version = ">1", markers = "python_version <= \"3.8\""} +pydantic = ">=2.0,<3.0.0" +pydantic-settings = ">=2.0,<3.0.0" +Sphinx = ">=4.0" + +[package.extras] +dev = ["coverage (>=7,<8)", "flake8 (>=3,<4)", "pytest (>=7,<8)", "sphinx-copybutton (>=0.4,<0.5)", "sphinx-rtd-theme (>=1.0,<2.0)", "sphinx-tabs (>=3,<4)", "sphinxcontrib-mermaid (>=0.7,<0.8)", "tox (>=3,<4)"] +docs = ["sphinx-copybutton (>=0.4,<0.5)", "sphinx-rtd-theme (>=1.0,<2.0)", "sphinx-tabs (>=3,<4)", "sphinxcontrib-mermaid (>=0.7,<0.8)"] +erdantic = ["erdantic (>=0.6,<0.7)"] +test = ["coverage (>=7,<8)", "pytest (>=7,<8)"] + [[package]] name = "babel" version = "2.13.1" @@ -2629,4 +2652,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "821efb9756c168ad7eec23c00b864275d14affa92cae2f940ca0667ad55e9b4e" +content-hash = "1c672e161ffc2f1472e7464015a7cb3e57310df856521644ce11ad21426501ee" diff --git a/pyproject.toml b/pyproject.toml index 840c1ede..da3b82b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ optional = true sphinx = "^7.0.0" sphinx-rtd-theme = "^2.0.0" sphinx-issues = "^3.0.0" +autodoc-pydantic = "^2.0.1" myst-parser = "^2.0.0" [tool.black] diff --git a/web/requirements.doc.txt b/web/requirements.doc.txt index 35017f42..6e3e579d 100644 --- a/web/requirements.doc.txt +++ b/web/requirements.doc.txt @@ -1,4 +1,6 @@ alabaster==0.7.13 ; python_full_version >= "3.8.1" and python_version < "4.0" +annotated-types==0.6.0 ; python_full_version >= "3.8.1" and python_version < "4.0" +autodoc-pydantic==2.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" babel==2.13.1 ; python_full_version >= "3.8.1" and python_version < "4.0" certifi==2023.11.17 ; python_full_version >= "3.8.1" and python_version < "4.0" charset-normalizer==3.3.2 ; python_full_version >= "3.8.1" and python_version < "4.0" @@ -14,7 +16,11 @@ mdit-py-plugins==0.4.0 ; python_full_version >= "3.8.1" and python_version < "4. mdurl==0.1.2 ; python_full_version >= "3.8.1" and python_version < "4.0" myst-parser==2.0.0 ; python_full_version >= "3.8.1" and python_version < "4.0" packaging==23.2 ; python_full_version >= "3.8.1" and python_version < "4.0" +pydantic-core==2.14.5 ; python_full_version >= "3.8.1" and python_version < "4.0" +pydantic-settings==2.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0" +pydantic==2.5.2 ; python_full_version >= "3.8.1" and python_version < "4.0" pygments==2.17.2 ; python_full_version >= "3.8.1" and python_version < "4.0" +python-dotenv==1.0.0 ; python_full_version >= "3.8.1" and python_version < "4.0" pytz==2023.3.post1 ; python_full_version >= "3.8.1" and python_version < "3.9" pyyaml==6.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" requests==2.31.0 ; python_full_version >= "3.8.1" and python_version < "4.0" @@ -30,5 +36,6 @@ sphinxcontrib-jquery==4.1 ; python_full_version >= "3.8.1" and python_version < sphinxcontrib-jsmath==1.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" sphinxcontrib-qthelp==1.0.3 ; python_full_version >= "3.8.1" and python_version < "4.0" sphinxcontrib-serializinghtml==1.1.5 ; python_full_version >= "3.8.1" and python_version < "4.0" +typing-extensions==4.8.0 ; python_full_version >= "3.8.1" and python_version < "4.0" urllib3==2.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0" zipp==3.17.0 ; python_full_version >= "3.8.1" and python_version < "3.10"