2.2.0 (2024-04-26)
- Allow empty strings for directive prefixes (#285) (be21d37)
- Remove duplicated docs strings when
use_attribute_docstrings
is used inpydantic >= 2.7
(#276) (0ddb12f)
- deps: update dependency erdantic to <v2 (#246) (3c8daa8)
- deps: update dependency erdantic to ^0.7.0 (#226) (0909963)
- deps: update dependency flake8 to v7 (#233) (c270e8a)
- deps: update dependency pytest to v8 (#234) (8b330af)
- deps: update dependency sphinx-copybutton to ^0.5.0 (#227) (7ada937)
- deps: update dependency sphinx-rtd-theme to v2 (#235) (f43cfa9)
- deps: update dependency sphinxcontrib-mermaid to ^0.9.0 (#229) (984ce05)
- Improve error message for
_sort_summary_list
failures (#243) (87923a1) - Test please-release (d4595bf)
- Use more precise
name
instead ofobject_name
for_sort_summary_list
error msg (#244) (42bdd4b)
- Add
changelog-sections
to please-release (#218) (5355f98) - Add
refactor
and more categories to release-please configuration. (#258) (71e1c60) - Add Coduim PR Agent Workflow (#236) (38f9e16)
- Configure Renovate (#225) (efc2f9a)
- Deactivate dependency dashboard (#238) (11afaf3)
- deps: update abatilo/actions-poetry action to v3 (#230) (be248a4)
- deps: update actions/checkout action to v4 (#231) (5774bdf)
- deps: update actions/setup-python action to v5 (#232) (2bc973b)
- fix link in all-contributors bot (#281) (8261254)
- improve changelog (b22840f)
- Remove
dev
extras andtox
from pyproject.toml (204f246) - Remove dependabot in favor for Mend's renovate (#267) (9726cc5)
- Revert all-contributors commit type (#282) [skip ci] (c4c8fe7)
- Use ruff for linting and formatting (#242) (461be30)
- add exs-dwoodward as a contributor for code (#250) (532b54f)
- Add hint mentioning that pydantic directive prefixes allow empty strings (be21d37)
- Add missing erdantic version number (#224) (4c9c6b2)
- Fix broken link in example section (40b5b22)
- Improve
README.md
with update badges and remove animated gif comparison examples (40b5b22) - improve erdantic example (3c8daa8)
- Recommend globally installed tox instead of poetry installed tox (#223) (204f246)
- Remove pydantic v1/v2 branch note from developer setup guide (204f246)
- Replace Sphinx
index.rst
with repo'sREADME.md
(#270) (40b5b22) - Use
myst_parser
to includeCHANGELOG.md
instead of rst (#245) (e6fe9e1)
- Add
pip-audit
security scanner (#268) (0be2710) - Add daily scheduled GH workflow with test for pre-release versions (#265) (a4c5140)
- Add dependabot configuration (#248) (dc0a81d)
- Add explicit
pydantic_settings
versions to prevent unwanted pydantic version upgrades in CI matrix (#263) (2c5c4d5) - Add pydantic 2.7 to test matrix (#253) (afdec96)
- fix broken tox environment naming convention preventing correct version selection (134c3cb)
- Fix incorrect tox env name for security scans (#271) (bcb9ee0)
- Ignore release-please branches for CI tests (#221) (5f4c0dc)
- Integrate
mypy
type checking (#259) (134c3cb) - Move publish step into release-please workflow (#237) (0864395)
- Protect workflows via CODEOWNERS and explicit user matching (#240) (c07d1f2)
- Refactor CI with resusable, custom GitHub Action (#252) (0d582c7)
- Replace flake8 with ruff for linting/formatting (461be30)
- Streamline GH workflow names (0be2710)
- Support pydantic 2.7 and sphinx 7.3 (#261) (a797a77)
- Update codcov GH action to newest version (#219) (b129602)
- Update GH Actions to newest Versions (#222) (5a21c2a)
- Fix warnings due to deprecated test examples (#273) (65ed9cc)
- remove
package_is_missing
(3c8daa8) - Remove obsolete test classes (65ed9cc)
- simplify erdantic tests (3c8daa8)
- Move extension setup logic into seperate
application
module (#264) (e8f7f06) - rename
PydanticDirectiveBase
toPydanticDirectiveMixin
for better clarity (134c3cb) - restructure sphinx app cfg values in
__init__
(134c3cb)
- update dependency myst-parser to v3 (#269) (4c3e61f)
- update dependency ruff to ^0.4.0 (#256) (4eb1629)
- add annerademacher as a contributor for financial (#284) (80cf3e9)
- add azmeuk as a contributor for bug (#286) (36056f7)
- add bruno-f-cruz as a contributor for bug (#280) (47e98df)
- add Carson-Shaar as a contributor for bug (#278) [skip ci] (bc4cdb6)
- add Galarzaa90 as a contributor for bug (#277) (15cead4)
- add ITProKyle as a contributor for bug (#279) [skip ci] (2a899f1)
- add lwasser as a contributor for bug (#262) (83d2b94)
This is a maintenance and bugfix release extending support to pydantic v2.6, sphinx v7.2 and python 3.12 while dropping support for python 3.7 which has reached EOL.
- Hide
model_computed_fields
for pydantic models. - Hide
settings_customise_sources
for pydantic settings.
- Add pydantic 2.2/2.3/2.4/2.5/2.6 and sphinx 7.1/7.2 and python 3.12 to test matrix.
- Remove python 3.7 from test matrix.
- Remove obsolete
skip ci
condition from github actions. - Update
conftest
to usepathlib
instead of older Sphinxsphinx.testing.path
module that is being deprecated for forward-compatibility with newer Sphinx versions. - Fix duplicated teset name
test_non_field_attributes
. - Add tests to cover inheritance behavior given
inherited-members
for field and validator members and summaries.
- Fix incompatibity with sphinx 7.2 due to changed usage of path objects. For more, see #11606.
- #176
Remove
sphinxcontrib/__init__.py
causingModuleNotFoundError
exception in some environments. This should be a namespace package per PEP 420 without__init_.py
to match with other extensions. - Removing deprecation warning
sphinx.util.typing.stringify
. - Fix bug a bug while sorting members #137.
- Fix deprecation warning for tuple interface of
ObjectMember
indirectives/autodocumenters.py
. - Remove obsolete configuration options which have been removed in v2.
- Introduce
pydantic.options.exists
to check for existence of sphinx options.
- Add pydantic to PyPI classifiers to improve discoverability.
- Correct erdantic installation command in users coniguration section.
- Improve users FAQ regarding documentation of inherited members.
- Thanks to devmonkey22 for providing a PR to solve a nasty namespace package issue #176 and daquinteroflex for testing and providing feedback.
- Thanks to rafa-guedes for
providing a PR to fix a deprecation warning for tuple interface of
ObjectMember
indirectives/autodocumenters.py
#174 and j-carson for reporting it. - Thanks to caerulescens for providing a PR to add pydantic to PyPI classifiers #179.
- Thanks to spacemanspiff2007
for hiding
model_computed_fields
andsettings_customise_sources
#202. - Thanks to tony for fixing a typo in the erdantic docs #200.
- Thanks to j-carson for providing a PR that:
This is a bugfix release handling an exception while documenting pydantic models using enums.
- Simplify model field's constraint extraction removing dependency on private methods.
- Properly handle constraint extraction avoiding exceptions due to prior reliance on unpredictable behavior of private attributes.
- Fix incorrect type annotation string results for non-builtin types
in
intercept_type_annotations_py_gt_39
.
- Add pydantic 2.1 to test matrix.
- Add tests for various kinds of constrained types.
- Add "no exception" tests for specific pydantic models, such as containing enums.
- Thanks to nagledb for reporting a bug related to enums #169.
- Thanks to jerryjiahaha for providing a pull request fixing the enums bug #170.
This is a major release supporting pydantic v2. In June 2023, pydantic v2 was released while introducing backwards incompatible API and behavioral changes in comparison to pydantic v1. Supporting pydantic v2 required substantial adjustments to the codebase leading to a new major release of autodoc_pydantic (v1.9.0 -> v2.0.0), too.
In order to keep the codebase clean and concise, separate versions for v1 and v2 were created. The v2 branch will eventually become the new main branch while the code for v1 remains in the main-1.x branch.
- Documenting pydantic model configurations in isolation or as a
separate member of the pydantic model is no longer available. The
following options have been removed:
autodoc_pydantic_model_show_config_member
autodoc_pydantic_settings_show_config_member
autodoc_pydantic_config_members
autodoc_pydantic_config_signature_prefix
- All semantic changes from pydantic v1 to v2 take full effect. autodoc_pydantic does not modify the underlying behavior of pydantic in any way. Instead, it only documents whatever pydantic exposes. Hence, all behavioral changes such as the new default strict mode are preserved in v2.
- Sphinx
< 4.0.0
is no longer supported.
- Support for pydantic v2 💫.
- Support annotated type hints.
- Adjust imports to refer to
pydantic-settings
(v2) instead ofpydantic
(v1). - Adjust imports to refer to
field_validator
(v2) insteaf ofvalidator
(v1). - Adjust imports to refer to
model_validator
(v2) insteaf ofroot_validator
(v1). - Replace
pydantic.generics.GenericModel
(v1) withtyping.Generic
(v2). - Simplify
ValidatorAdapter
andValidatorInspector
. - Simplify reused validators retrieval.
- Completely rewrite the model's field constraint retrieval
functionality in
inspection.FieldInspector
. - Adjust model's field serializability checks in
inspection.FieldInspector
. - Replace
BaseModel
withNamedTuple
forValidatorAdapter
. - Remove obsolete pre/post validator attributes.
- Introduce
importlib-metadata
to fetch version number including support for python 3.7.
- Remove all obsolete pydantic versions from test matrix.
- Remove all tests for documenting config members.
- Remove compatibility helpers for older pydantic versions.
- Remove obsolete pydantic model example which was not used anywhere.
- Adjust serializability tests to account for changed behavior in v2.
- Adjust optional/required field marker tests to account for changed behavior in v2.
- Adjust field constraint tests to account for changed behavior in v2.
- Adjust erdantic tests to exclude the erdantic version number which caused tests to fail upon erdantic update.
- Add FAQ section regarding migration guide from v1 to v2.
- Remove
complete
showcase from user's example. - Update READMEs with newest features and version specifiers.
- Update developer's setup section to address v1 to v2 changes.
- Updates user's installation section to address v1 to v2 changes.
- Remove all obsolete documentation on removed config documenters.
- Rename all occurences to v2
field_validator
andmodel_validator
.
- Special thanks to awoimbee for providing a draft for the v1 to v2 migration which really initiated the work on supporting pydantic v2 #160.
- Many thanks to PriOliveira for reviewing changes required for the v1 to v2 release #160.
This is a feature release adding support for entity relationship diagrams while dropping python 3.6. Additionally, pydantic v2 is currently excluded until support will be added. Moreover, newest sphinx versions are added to test matrix.
- Introduce
erdantic-figure
anderdantic-figure-collapsed
configuration option for pydantic models to add entity relationship diagrams to models' documentation either in collapsed form or as an image included to the HTML. #148.
- Run github actions on newest
ubuntu-22.04
. - Fix pytest errors with
sphinx>=6.1
where the type returned byautodoc_typehints_format
changed. - Provide upper version boundary for pydantic to exclude v2 which is not supported, yet.
- Add
to_collapsable
todirectives.templates
that provides a standardized interface to create a collapsable field. - Add
erdantic
to extras dependencies.
- Add descriptions for
erdantic-figure
anderdantic-figure-collapsed
options in the configuration section. - Add an example of ERD in the example section.
- Exclude
python 3.6
in test matrix. - Include
sphinx
6.0, 6.1, 6.2 and 7.0 in test matrix. - Add tests for
erdantic-figure
anderdantic-figure-collapsed
. - Fix github actions CI pipeline due to unsupported ubuntu while
upgrading to newest
ubuntu-22.04
.
- Many thanks to yves-renier for adding entity relationship diagrams and fixing the CI pipeline #148.
This is a feature and bugfix release with major internal refactorings
and added support for pydantic 1.10
and sphinx 5.1
and 5.2
.
- Introduce
hide-reused-validator
configuration option for pydantic models and settings to hide class methods that are created while declaring functions as reusable validators #122.
- Fix incorrect reference of reused validators #122.
- Provide deterministic sort order for model's validator summary and field's validator list.
- Hide pydantic user warnings in sphinx output when testing for pydantic field serializability.
- Add
ValidatorAdapter
that provides a standardized interface to pydantic's validator objects with additional metadata (e.g. root validator) for internal usage in autodoc_pydantic. - Introduce
field_validator_mappings
toinspection.ModelInspector
which holds all mappings between fields and validators. It makes many helper functions ofValidatorInspector
andFieldInspector
obsolete. Overall, this greatly simplifies the inspection codebase. - Add
PydanticAutoDoc.resolve_inherited_validator_reference
to allow proper reference resolution for inherited validators.
- Add description for
autodoc_pydantic_model_hide_reused_validator
andautodoc_pydantic_settings_hide_reused_validator
. - Add example section for reused validators with detailed explanation.
- Refactor sphinx extension helper for building
autodoc_pydantic
docs for better readability and maintainability. - Add
example_path
to sphinx extension helperconfig_description
. - Add FAQ question regarding interoperability with
autoapi
.
- Include pydantic
1.10
and sphinx5.1
/5.2
in test matrix. - Provide compatibility for new pydantic and sphinx versions.
- Fix incorrect pydantic version comparison.
- Thanks to GlenNicholls for reporting a bug regarding incorrect references of reused validators #122 .
- Thanks to csm10495 for asking a
question regarding
autoapi
interoperability #138 .
This is a bugfix release.
- Adjust
PydanticFieldDocumenter.can_document_member
to ignore non pydantic fields #123, #128. - Allow pydantic models to be documented as class attributes while
adjusting
ModelInspector.from_child_signode
to support nested object paths #124, #129.
- Thanks to sneakers-the-rat and PipeKnight for reporting a bug when encountering attributes that are not pydantic fields #123, #128.
- Thanks to iwishiwasaneagle
and nickeldan for reporting a bug
pydantic models were documented as class attributes or
ModelInspector.from_child_signode
returned the incorrect model reference #124, #129.
- Renamed
from_signode
tofrom_child_signode
for better clarity. - Added explicit check to raise an exception if loaded object in
ModelInspector.from_child_signode
is not a pydantic model.
This is a bugfix release supporting sphinx 5.0.
- Adjust modified function signature of
sphinx.ext.autodoc.ClassDocumenter.add_content
in sphinx 5.0 which causes a type error otherwise #125 .
- Convert
sphinx-tabs
andsphinxcontrib-mermaid
to optional deps and relax their version specification.
- Add sphinx 5.0 to test matrix.
- Adjust several tests for changed default behaviour of
autodoc_typehints_format
.
This is a feature release.
- Default values of pydantic fields such as
UndefinedPydantic
andEllipsis
will now be shown asNone
.
- Fix missing validator-field references in
model-show-validator-summary
in case a single validator method process multiple fields.
- Add
autodoc_pydantic_field_show_optional
configuration which provides[Optional]
marker for pydantic fields withdefault_factory
. This configuration is activated by default. If deactivated, default values might be displayed incorrectly. For more, see #114 - Add
autodoc_pydantic_field_swap_name_and_alias
configuration which allows to use a field's alias as a name instead of the original field name #99 . - Respect interaction between
autodoc_pydantic_field_swap_name_and_alias
withmodel-show-validator-summary
,model-show-field-summary
,validator-replace-signature
andvalidator-list-fields
by replacing the field name with field alias in rendered documentation.
- Determining default values of pydantic fields no longer use
Field.field_info.default
butField.default
. As a consequence, default values such asUndefinedPydantic
andEllipsis
will now be shown asNone
. - Autodocumenter
PydanticFieldDocumenter
now passesfield-show-alias
andalias
toPydanticField
directive. Before, onlyalias
was passed with value to denotefield-show-alias
. However, sincefield-swap-name-and-alias
was added, the value of the alias might be required even withoutfield-show-alias
being activated. - Refactor and split
PydanticModelDocumenter.add_validators_summary
in multiple methods for better readability and maintainability. - Add
get_field_name_or_alias
toPydanticAutoDoc
to centrally manage the determination of field name/alias for all auto-documenters. - Rename
sanitize_configuration_option_name
intodetermine_app_cfg_name
indirectives/options/composites.py
for better clarity. - Add
configuration_names
toAutoDocOptions
to distinguish foreign directive options indetermine_app_cfg_name
which is required becausefield-swap-name-and-alias
is also used by model/validator auto-documenters.
- Add example section for
field-swap-name-and-alias
. - Add configuration description for
field-swap-name-and-alias
.
- Thanks to spacemanspiff2007
for providing and supporting a feature request to show
[Optional]
marker #114 and a feature request to swap name and alias #99 .
This is a documentation and bugfix release supporting sphinx 4.5.
- Fix incorrect source-to-doc hyperlink in users example section #96.
- Fix incorrect
[Required]
mark for optional fields likeOptional[int]
#97. - Fix incorrect warning of JSON non-serializable field in case of
composite types like
Union
. #98. - Fix incorrect showing of additional keyword arguments passed to pydantic [Field]{.title-ref} in the field's constraint documentation section #110.
- Separate example page into configuration and specifics.
- Add examples for required and optional values.
- Add examples for generic models.
- Use separate python modules for user's usage and example sections to prevent ambiguous source-to-doc hyperlinks.
- Add sphinx 4.5 to CI.
- Add test to ensure that optional fields do not have the
[Required]
mark. - Add test to ensure that pydantic field with composite type like
Union
is correctly identified as JSON serializable. - Add test to ensure that additional keyword arguments passed to pydantic [Field]{.title-ref} are not shown in the field's constraint documentation section.
- Pin
jinja2<3.1.0
forsphinx<4
to fix broken CI.
- Thanks to jgunstone for reporting a bug regarding incorrect source-to-doc hyperlink in users example section.
- Thanks to Czaki for reporting a bug
regarding incorrect warning of JSON non-serializable field in case
of composite types like
Union
. - Thanks to StigKorsnes for
reporting a bug regarding incorrect
[Required]
mark for optional fields likeOptional[int]
- Thanks to spacemanspiff2007 for reporting a bug regarding incorrect showing of additional keyword arguments passed to pydantic [Field]{.title-ref} in the field's constraint documentation section.
This is a minor bugfix release including support for sphinx 4.4.
- Fix incorrect rendering of pydantic field's
description
attribute which was not in line with default reST rendering of docstrings of classes or functions. #91.
- Add test to ensure that pydantic field's
description
attribute is correctly rendered. - Add sphinx 4.4 to CI.
- Simplify
test_autodoc_pydantic_settings_hide_paramlist_false
replacing version specifics with generic assert function.
- Thanks to iliakur for reporting the
incorrect reST rendering of pydantic field's
description
attribute.
This is a feature and bug fix release including support for pydantic 1.9.
- Documented pydantic models/settings as class attributes will no longer show additional content #78.
- Generated docutils will now have additional fallback css classes #77.
- Fix a bug which occurred while documenting a pydantic model as an attribute and using [bysource]{.title-ref} for model summary list order #78.
- Remove any additional content generated by autodoc_pydantic for pydantic models/settings when documented as an attribute #78.
- By default add fallback css classes for all docutils generated by
autodoc_pydantic. This can be deactivated via newly added config
autodoc_pydantic_add_fallback_css_class
#77.
- Add tests to ensure that no additional content is provided if model/settings are documented as an attribute, see [test_edgecases]{.title-ref}.
- Add tests to ensure that fallback css classes are added if required, see [test_events]{.title-ref}.
- Streamline naming convention for tests regarding edge cases.
- Adjust tests to comply with pydantic 1.9.
- Add pydantic 1.9 to CI.
- Add
prod_app
fixture to run production sphinx app based on cmd line entry point while returning captured sphinx app and doctrees. - Provide important doc strings to existing
autodocument
,parst_rst
andtest_app
fixtures for better understandability.
- Add FAQ section describing changed behaviour of models/settings when used as class attributes.
- Add FAQ section describing fallback css classes.
- Rename
BaseModel
toModel
andBaseSettings
toSettings
in configuration section. - Add
autodoc_pydantic_add_fallback_css_class
setting to users configuration page. - Add
ShowVersions
directive to show relevant package versions of current documentation build environment in setup page of developer documentation.
- Thanks to StigKorsnes for
reporting an unexpected behavior when using autodoc_pydantic
with themes like Jupyter-Book that rely on setting css styles for
default sphinx autdoc objtypes
class
,attribute
andmethod
#77. - Thanks to nchaly for reporting a bug and raising the topic of how to document models/settings as an attribute #78.
This is a minor bug fix release with testing and documentation improvements. Additionally, it adds support for sphinx 4.3.
- Fix a corner-case where a module that imported
numpy.typing.NDArray
caused autodoc_pydantic to experience an uncaught exception #57.
- Account for modified method signature in
get_signature_prefix
in sphinx 4.3 #62.
- Fix broken CI for sphinx 3.4 due to unpinned versions of
docutils
. This generates new sphinx loggings which have not been present before that in turn cause tests to fail which are dependent on inspecting sphinx loggings #68. - Add sphinx 4.3 to CI matrix.
- Add compatibility module to abstract away minor implementation differences between sphinx versions 4.3 and prior.
- Add tests for development versions while continuing on error.
- Replace codacy with codecov for code coverage reports.
- Add code coverage for all stable and latest version.
- Allow CI to be executed on pull requests from forks of new contributors.
- Add
Exclude __init__ docstring
section to FAQ of the user guide #58. - Add github issue links to topics of FAQ of the user guide.
- Thanks to j-carson for reporting a bug and providing a PR related to autodoc_pydantic's inspection module #57.
- Thanks to Yoshanuikabundi and jakobandersen for reporting and mitigating a compatibility issue with sphinx 4.3 #62.
- Thanks to lilyminium for adding the
Exclude __init__ docstring
section to FAQ of the user guide #58.
This release includes major internal refactorings, new documentation sections, a new feature, a bug fix and tests for new sphinx and python versions.
- Provide
summary-list-order
configuration property which allows to sort summary list items in alphabetical order or by source.
- Using
@root_validator(pre=True)
caused the sphinx build process to fail due to an incorrect implementation. This has been fixed. #55.
- Refactor all configuration test modules removing repeated function arguments to increase readability and maintainability.
- Add specific test to ensure that using
@root_validator(pre=True)
does not break the sphinx build process. - Add sphinx versions
4.1.0
and4.2.0
to CI matrix. - Add python version
3.10
to CI matrix.
- Add section in configuration page describing
summary-list-order
. - Add developer design section providing gentle introduction to code base.
- Add developer guides focusing on concrete implementation details.
- Add class diagrams via mermaid.js.
- Streamline naming convention for
TabDocDirective
for better clarity. - Add
version
parameter toTabDocDirective
to show the version in which a configuration property was added. - Add API documentation for selected modules including directory tree with references.
- Activate
sphinxcontrib.mermaid
andsphinx.ext.viewcode
extensions.
- Completely remove the
ModelWrapper
with theModelInspector
with all its composite classes. - Moving inspection logic from auto-documenters to
ModelInspector
. - Streamline naming conventions for composite classes.
- Create separate sub directory for directive options including individual modules for composites, definitions, enums and validators.
- Move reST templates to separate module.
- Update to newest versions of
sphinx-rtd-theme
andsphinx-tabs
. - Add
sphinxcontrib-mermaid
under dev and doc dependencies.
- Thanks to goroderickgo for reporting a bug related to pre root validators breaking the sphinx build process #55.
This is a feature and bug release.
- Provide
field-show-required
configuration property. If activated, it adds a[Required]
marker for pydantic fields which do not have a default value. Otherwise, misleading default values like Ellipsis or PydanticUndefined are shown. #34. - Include
show-json-error-strategy
for pydantic models and settings to define error handling in case a pydantic field breaks the JSON schema generation #8.
- Respect
inherited-members
for field and validator summaries to prevent different members being displayed between header and body #32. - Improve handling of non serializable pydantic fields for JSON model
generation. Using
pd.DataFrame
as a type annotation raised an exception instead of being handled appropriately #28. - Allow typed fields within doc strings to successfully reference pydantic models and settings #27.
- Remove
env
key from field constraints.
- Add explicit tests for references originating from typed fields.
- Add more diverse tests for handling non serializable fields breaking JSON model generation.
- Add tests for different error handling strategies regarding
show-json-error-strategy
. - Add tests for
field-show-required
. - Add tests for field and validator summaries respecting
inherited-members
.
- Add section in configuration page describing
show-json-error-strategy
. - Add section in configuration page describing
field-show-required
. - Add FAQ page with section about using
inherited-members
. - Generally overhaul the documentation to improve readability and conciseness.
- Thanks to davidchall for suggesting
to add a
[Required]
marker for mandatory pydantic fields #34. - Thanks to matutter for reporting a
bug related to incorrect field and validator summaries not
respecting
inherited-members
#32. - Thanks to thomas-pedot for reporting a bug related to error handling of pydantic fields breaking JSON schema generation #28.
- Thanks to tahoward for reporting a bug related to missing references in typed fields #27.
This is a minor release including the following:
- Providing support for
root_validator
#20 . - Fixing a bug concerning overwriting
member-order
#21 . - Integrating flake8 for static code analysis.
- Fix
member-order
being overwritten by autodoc pydantic's autodocumenters #21.
- Add example showing representation of asterisk and root validators.
- Add [sphinx-copybutton]{.title-ref} extension.
- Add explicit tests for asterisk and root validators.
- Add test case ensuring that
member-order
is not affected by other auto-documenters. - Fix several tests which in fact tested wrong behaviour.
- Refactor and simplify field validator mapping generation of
inspection.ModelWrapper
. - Replace
set_default_option_with_value
with specificset_members_all
. - Create separate copy for every auto-documenters
option
object to prevent shared options.
- Thanks to roguh for submitting a feature
request for
root_validators
#20. - Thanks to ybnd for submitting a bug
report concerning incorrect behaviour for
member-order
#21
This is a release focusing on testing and packaging. It includes tests
for sphinx 4.0 support. Additionally, it moves all test invocation
specifications to tox.ini
.
- Add acknowledgements to index.
- Add detailed description for running tests with pytest and tox.
- Convert changelog page from markdown to reST.
- Use tox for defining different test environments (specific stable,
latest stable and development). Remove test environment
specifications from github ci and move it to
tox.ini
addressing #7. - Add sphinx 4.0 to test environments addressing #16.
- Define specific test environments instead of testing all matrix combinations.
- Provide version information about autdoc_pydantic and relevant dependencies.
- Replace
pytest-cov
withcoverage
. - Remove
myst-parser
dependency addressing #16. - Add
tox
for executing tests in CI. - Remove poetry development dependencies and replace it with explicit
extras
for docs, test and dev.
- Rename
util
module tocomposites
to improve naming convention.
show_versions
function to show important dependency information which are relevant for tracking down bugs as part of the newutility
module.
This is a feature release adding the field summary for pydantic models/settings.
- Refactor and simplify sphinx extension
helper
module for better maintainability and readability. - Improve many of the available descriptions in the
configuration
section. - Provide correct markers for the actual default values in the
configuration
section.
- Introduce
model-show-field-summary
andsettings-show-field-summary
which partially addresses #14.
- Add
get_fields
toinspection
module.
This is a patch release addressing missing cross reference ability and minor refactorings.
- Add
add_domain_object_types
to extensionsetup
. - Add version and extension meta data to
setup
. - Refactor rather complex
setup
into separate functions.
- Rename test directory
test-ext-autodoc-pydantic
totest-base
to streamline naming convention. - Add test directory
test-edgecase-any-reference
to mock issue with failing:any:
reference to pydantic objects includingtest_any_reference
test. - Add
test_sphinx_build
test module to check that the sphinx docs build without error and warning which can be seen as an end to end test because autodoc_pydantic's documentation is built with sphinx and contains an entire collection of usage examples for autodoc_pydantic itself.
- Enable cross referencing of pydantic objects which are documented
with autodoc_pydantic directives and linked via
:any:
role #3.
- Add complete configuration and fields only example to documentation.
This is a bugfix release on compatibility issues with sphinx autosummary.
- Remove custom object import and use autodoc's provided functionality.
- Add
option_is_true
andoption_is_false
forPydanticAutoDirective
respecting missing values via customNONE
object. - Move member option processing from
__init__
todocument_members
forPydanticModelDocumenter
. - Introduce
PydanticDirectiveBase
base class for all pydantic directives to remove code redundancies.
- Respect
.. currentmodule::
directive for object imports #12. - Make
autosummary
'sFakeDirective
work with pydantic autodocumenters #11. - Allow
AutoSummary.get_items
to successfully list pydantic autodocumenters which wrap objects imported to external modules #11.
- Add
autosummary
explanation to usage section.
- Add test module for ensuring
autosummary
interoperability.
This is a minor release with focus on refactoring and doc strings.
- Several minor readability refactorings.
- Add changelog and
myst_parser
for parsing markdown files.
- Add animated example to showcase difference between standard sphinx autodoc and pydantic autodoc.
- Add project logo.
- Add changelog.
This is small feature release enabling autodoc_pydantic
to handle non
JSON serializable fields properly.
- Replace inspection methods that use models JSON schema with methods that directly access relevant pydantic object attributes.
- Intercept non JSON serializable fields and overwrite types and default values indicating serialization error.
- Add explicit note about how non JSON serializable fields are handled
for
model-show-json
andsettings-show-json
.
This is a major release providing API stability with main focus on extensive tests and documentation.
- Add custom css for
autodoc_pydantic
extension.
- Add
PydanticAutoDirective
as composite class to mainly manage option/configuration management for directives. - Add
PydanticAutoDoc
as composite class to mainly manage option/configuration management for autodocumenters. - Unify directive options and global configuration settings via composite classes.
- Add option validators
option_members
,option_one_of_factory
,option_default_true
,option_list_like
.
- Add extensions to automate documentation generation:
ConfigurationToc
to generate options/conf toc mappings from usage to configuration sectionTabDocDirective
to generate rendered examples in configuration sectionAutoCodeBlock
to generate code block from object path- Add user guide:
- Installation
- Usage
- Configuration
- Examples
- Add developer guide:
- Setting up development environment
- Running tests
- Building docs
- Add
.readthedocs.yaml
.
- Add test python package with code examples for test execution (same structure as sphinx tests).
- Add fixture
test_app
to instantiate test app with settable configuration settings. - Add fixture
autodocument
to handle restructured text generation tests (autodocumenter tests). - Add fixture
parse_rst
to handle node generation tests from restructured text (directive tests). - Add autodoc/directive tests for all available configuration settings
- Include sourcery in CI pipeline.
- Modify package dependencies to
sphinx >=3.4
andpydantic >= 1.5
.
This release adds the sphinx documentation skeleton.
- Add initial sphinx documentation.
This is the initial of autodoc_pydantic.
- Autodocumenter
PydanticModelDocumenter
with configurations:model_show_json
model_show_config_member
model_show_config_summary
model_show_validator_members
model_show_validator_summary
model_hide_paramlist
model_undoc_members
model_members
model_member_order
model_signature_prefix
- Autodocumenter
PydanticSettingsDocumenter
with configurations:settings_show_json
settings_show_config_member
settings_show_config_summary
settings_show_validator_members
settings_show_validator_summary
settings_hide_paramlist
settings_undoc_members
settings_members
settings_member_order
settings_signature_prefix
- Autodocumenter
PydanticFieldDocumenter
with configurations:field_list_validators
field_doc_policy
field_show_constraints
field_show_alias
field_show_default
field_signature_prefix
- Autodocumenter
PydanticValidatorDocumenter
with configurations:validator_signature_prefix
validator_replace_signature
validator_list_fields
- Autodocumenter
PydanticConfigClassDocumenter
with configurations:config_signature_prefix
config_members
- Directives
PydanticModel
,PydanticSettings
,PydanticField
,PydanticValidator
- Add
inspection
along withModelWrapper
module providing functionality to inspect pydantic objects to retrieve relevant informations for documentation.
- Add end to end tests for autodocumenters and directives.
- Setup github actions for CI.
- Add codacy integration.
- Add code coverage.
- Use poetry for package management.
- Add
pyproject.toml
. - Add github action to upload to PyPI upon version tags on main branch.