New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create an entity relationship diagrams of the schemas using erdantic #148
Conversation
…grams of the schemas using erdantic
Hi @yves-renier, thanks for your PR! You did a great job diving deeply into I really like the idea of adding the possibility to show ERDs for pydantic models. I'm happy to support this PR. So far, there remain some ToDos that we should address first:
Please feel free to comment on my thoughts here. I'm happy to discuss them. |
Hello, thanks for the support ! |
Thanks for continuing with the PR! If you get stuck or need any help, please don't hesitate to reach out. |
About example, I already added one at |
…s asked. Add documentation to install with erd option
About enabling the option for the complete example, I see it is presently an |
I just added a simple test. |
@yves-renier The PR looks great - well done! I can confirm that tests pass and documentation is rendered properly. I have a few thoughts remaining that prevent me from merging, yet:
I'm curious to get to know your thoughts on these points. |
|
…ic-figure-collapsed options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said before, you've submitted great PR! I really appreciate the work you've put into the project.
I've added multiple small comments/recommendations. I hope they are self-explanatory. If not, please reach out.
I think we still need to include a short note/hint in the documentation about installing erdantic
if the feature is enabled.
@yves-renier By the way, great work adding |
Agreed - I will incorporate that in a separate release.
What was the error you were running into? Without pycharm's debugger I would be lost. |
I made several small modifications:
|
Once again, thanks for all the great work you've put into this PR! It was a pleasure working with you :-). |
Bumps [autodoc-pydantic](https://github.com/mansenfranzen/autodoc_pydantic) from 1.8.0 to 1.9.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/mansenfranzen/autodoc_pydantic/blob/main/changelog.rst">autodoc-pydantic's changelog</a>.</em></p> <blockquote> <h2>v1.9.0 - 2023-06-08</h2> <p>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.</p> <p>Feature</p> <pre><code> - Introduce ``erdantic-figure`` and ``erdantic-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](mansenfranzen/autodoc_pydantic#148) <https://github.com/mansenfranzen/autodoc_pydantic/pull/148>`__. <p>Bugfix</p> <pre><code> - Run github actions on newest ``ubuntu-22.04``. - Fix pytest errors with ``sphinx&gt;=6.1`` where the type returned by ``autodoc_typehints_format`` changed. - Provide upper version boundary for pydantic to exclude v2 which is not supported, yet. Internal </code></pre> <ul> <li>Add <code>to_collapsable</code> to <code>directives.templates</code> that provides a standardized interface to create a collapsable field.</li> <li>Add <code>erdantic</code> to extras dependencies.</li> </ul> <p>Documentation</p> <pre><code> - Add descriptions for ``erdantic-figure`` and ``erdantic-figure-collapsed`` options in the configuration section. - Add an example of ERD in the example section. Testing </code></pre> <ul> <li>Exclude <code>python 3.6</code> in test matrix.</li> <li>Include <code>sphinx</code> 6.0, 6.1, 6.2 and 7.0 in test matrix.</li> <li>Add tests for <code>erdantic-figure</code> and <code>erdantic-figure-collapsed</code>.</li> <li>Fix github actions CI pipeline due to unsupported ubuntu while upgrading to newest <code>ubuntu-22.04</code>.</li> </ul> <p>Contributors</p> <pre><code>&lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="mansenfranzen/autodoc_pydantic@10434f76f8abb9faee39eab8f5baf3a7deca558c"><code>10434f7</code></a> Fix poetry urllib issue.</li> <li><a href="mansenfranzen/autodoc_pydantic@ff0838f4921239e473215b5ad1ee81b6ea4e69e6"><code>ff0838f</code></a> Merge pull request <a href="https://redirect.github.com/mansenfranzen/autodoc_pydantic/issues/155">#155</a> from mansenfranzen/all-contributors/add-tkaraouzene</li> <li><a href="mansenfranzen/autodoc_pydantic@fd83255a8a4808cc4bcc02f825bbbbc28a92c626"><code>fd83255</code></a> Add upper pydantic boundary.</li> <li><a href="mansenfranzen/autodoc_pydantic@4371c292f4b8f5fe7a735266eb0726f5fb1a5f5c"><code>4371c29</code></a> Add contributor.</li> <li><a href="mansenfranzen/autodoc_pydantic@97558522dd0e4f3ad603ef29227ed6939a436774"><code>9755852</code></a> docs: update .all-contributorsrc [skip ci]</li> <li><a href="mansenfranzen/autodoc_pydantic@33629ece29594ec442cb363c9cb885dc36b8809a"><code>33629ec</code></a> docs: update README.md [skip ci]</li> <li><a href="mansenfranzen/autodoc_pydantic@1605bbcb2b4b458963167c12bb2c92fe4c272789"><code>1605bbc</code></a> Merge pull request <a href="https://redirect.github.com/mansenfranzen/autodoc_pydantic/issues/154">#154</a> from mansenfranzen/fix_pydantic_v2_incompatibility</li> <li><a href="mansenfranzen/autodoc_pydantic@1b61fed303d56f5b82b5bae9d53a1969a3446394"><code>1b61fed</code></a> Provide upper version boundary to exclude pydantic v2.</li> <li><a href="mansenfranzen/autodoc_pydantic@19ca2ba9d6a76f6338ce0c267761da11f5a63d3c"><code>19ca2ba</code></a> Merge pull request <a href="https://redirect.github.com/mansenfranzen/autodoc_pydantic/issues/151">#151</a> from mansenfranzen/fix_docs_codecov</li> <li><a href="mansenfranzen/autodoc_pydantic@af8a6f249a4784269e7c16951eb005e5ef5c9029"><code>af8a6f2</code></a> Test new pytest and coverage versions.</li> <li>Additional commits viewable in <a href="mansenfranzen/autodoc_pydantic@v1.8.0...v1.9.0">compare view</a></li> </ul> </details> <br /> </code></pre> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=autodoc-pydantic&package-manager=pip&previous-version=1.8.0&new-version=1.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Hello,
I wanted to have ERD diagram for my models so I implemented this.
I added an option model-erdantic-figure to switch it off (it is currently on by default, but feel free to change that).
I also added the documentation for the option.