Skip to content
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

Use inspect.getdoc to get model description #657

Merged
merged 3 commits into from Jul 24, 2019

Conversation

@tiangolo
Copy link
Collaborator

commented Jul 13, 2019

Change Summary

Use inspect.getdoc to get model description instead of the custom function clean_docstring.

It also allows models to inherit a description, the same way classes inherit a docstring.

Ref: https://docs.python.org/3/library/inspect.html#inspect.getdoc

Related issue number

Minor change without issue.

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • HISTORY.rst has been updated
    • if this is the first change since a release, please add a new section
    • include the issue number or this pull request number #<number>
    • include your github username @<whomever>

tiangolo added some commits Jul 13, 2019

Use inspect.getdoc to get model description
This instead of the custom function clean_docstring.
It also allows models to inherit a description, the same way classes inherit a docstring.
@tiangolo

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 13, 2019

Let me know if you want to have extra tests for models inheriting the description.

@codecov

This comment has been minimized.

Copy link

commented Jul 13, 2019

Codecov Report

Merging #657 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #657   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines        2673   2672    -1     
  Branches      530    530           
=====================================
- Hits         2673   2672    -1
@samuelcolvin
Copy link
Owner

left a comment

LGTM, just conflicts and rebase/update history.

@samuelcolvin samuelcolvin merged commit 886d05e into samuelcolvin:master Jul 24, 2019

7 of 10 checks passed

Header rules No header rules processed
Details
Pages changed 2 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/project 100% (+0%) compared to bc60014
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
samuelcolvin.pydantic Build #20190723.6 succeeded
Details
samuelcolvin.pydantic (Job Python36) Job Python36 succeeded
Details
samuelcolvin.pydantic (Job Python37) Job Python37 succeeded
Details
@tiangolo

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 28, 2019

Sorry for the delay on this.

Thanks for moving it forward and merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.